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.

7 Responses to “Enabling boto logging”

  1. tej Says:

    Thanks it helps me to collect important boto logs.

  2. Derrick Petzold Says:

    TY for this. Saved me a nice headache :).

  3. Tom Says:

    Hey, thanks so much! For those of us new to python, this was completely unobvious.

  4. Sherry Wei Says:

    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!

  5. Rossen Says:

    Thanks so much!
    It is work very well!

  6. Alessandro Says:

    Thanks guy. It showed me something I could’t see with the boto debug option

  7. Alessandro Says:

    Thanks Guy this allowed to me to see something that was not showed with the boto debug option.

Leave a Reply