112. Logging for Various AWS SDK - qyjohn/AWS_Tutorials GitHub Wiki
This tutorials covers the logging for various AWS SDK's.
(1) AWS SDK for Java
This topic is covered in the following AWS documentation:
(2) AWS SDK for .NET
(3) AWS SDK for C++
(3) AWS SDK for Node.js
If you only need a high level view of what is happening, all you need to do is to update the logger configuration, as below:
var AWS = require('aws-sdk');
AWS.config.update({logger: console});
If you want to see the HTTP / HTTPS wire logs, do something similar to the following:
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
var pfunc = function(err, data)
{
console.log(this);
if (err)
{
console.log(err, err.stack);
} else
{
console.log(data);
}
}
s3.listBuckets(pfunc);
(4) AWS SDK for Python
import boto3
import logging
boto3.set_stream_logger(name='boto3')
boto3.set_stream_logger(name='botocore')
Be aware that when logging anything from 'botocore' the full wire trace will appear in your logs. If your payloads contain sensitive data this should not be used in production.
(5) Logging for EMRFS
Super useful single line command:
export HADOOP_ROOT_LOGGER="DEBUG,console"