Search code examples
aws-sdkaws-sdk-jsaws-sdk-nodejs

How to disable AWS SDK logging


I'm using AWS JavaScript SDK in nodejs application. SDK setup is as below.

const aws = require('aws-sdk');
aws.config.logger = console;

This config is creating too much noise on console and it's difficult to go over the log. I tried removing aws.config.logger = console; but that doesn't change anything, still every log is being printed on console.


Solution

  • You can try by disable the Main Console to print anything in the log bar. Put the below code in your main file through which your server get starts. Here is the code snippet:

    console.log = function(){};
    

    or

    console = function(){};
    

    Your complete code may look like:

    const aws = require('aws-sdk');
    aws.config.logger = console;
    console.log = function(){};