Boto3: Disable info messages in boto3 SNS

Created on 30 Aug 2017  路  1Comment  路  Source: boto/boto3

I am using logging python package to log my errors messages

import logging
logging.basicConfig(filename='messages.log', level=logging.INFO)
logging.info('some message')

it is writing my custom log messages to messages.log file working fine,

when I started using boto3 SNS library
when I publish messages to SNS, again

08/30/2017 11:07:05 AM Starting new HTTPS connection (1): sns.us-west-2.amazonaws.com

above extra line was writing to messages.log file automatically

I think by default logging package adding info messages to messages.log file correct me if I am wrong.

Is it really info messages are coming from boto3 SNS package ?? if yes, how to disable this info & warning messages that are coming from boto3 SNS package ???

Thanks

question

Most helpful comment

The connection messages come from the requests library.
You can change the logging level like so:

boto3.set_stream_logger('botocore.vendored.requests', logging.ERROR)

In general you can change the logging level of any namespace using the above function.
Here are the docs for set_stream_logger.

>All comments

The connection messages come from the requests library.
You can change the logging level like so:

boto3.set_stream_logger('botocore.vendored.requests', logging.ERROR)

In general you can change the logging level of any namespace using the above function.
Here are the docs for set_stream_logger.

Was this page helpful?
0 / 5 - 0 ratings