Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable info messages in boto3 SNS #1248

Closed
shaikshakeel opened this issue Aug 30, 2017 · 1 comment
Closed

Disable info messages in boto3 SNS #1248

shaikshakeel opened this issue Aug 30, 2017 · 1 comment
Labels

Comments

@shaikshakeel
Copy link

shaikshakeel commented Aug 30, 2017

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

@joguSD
Copy link
Contributor

joguSD commented Aug 30, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants