Enabling boto logging
When using the Python ‘boto’ library for accessing Amazon Web Services, to enable logging to a file at the ‘debug’ level, simply use the logging module’s configuration:
import logging
logging.basicConfig(filename="boto.log", level=logging.DEBUG)
Place this line near the top of your script, and logging will take place to a file in your current directory called “boto.log”.
I’m sure that this is obvious for most people who use the Python logging module, but this is new code to me, and it took me a fair bit of looking to find out how to enable logging; hopefully other people find it more easily now.
June 28th, 2010 at 10:14 am
Thanks it helps me to collect important boto logs.
August 25th, 2011 at 9:00 pm
TY for this. Saved me a nice headache :).
October 8th, 2012 at 10:26 pm
Hey, thanks so much! For those of us new to python, this was completely unobvious.
August 2nd, 2013 at 12:30 pm
How do I just log my own python files but not boto generated logs? When I used the method above, my own log and boto log are all mixed in one file. I like to just log mine, but not boto (it has too much stuff). Thanks!
September 30th, 2014 at 2:45 pm
Thanks so much!
It is work very well!
April 16th, 2015 at 4:40 am
Thanks guy. It showed me something I could’t see with the boto debug option
April 16th, 2015 at 4:41 am
Thanks Guy this allowed to me to see something that was not showed with the boto debug option.