Enabling boto logging

Written by

in

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.

Comments

7 responses to “Enabling boto logging”

  1. tej Avatar
    tej

    Thanks it helps me to collect important boto logs.

  2. Derrick Petzold Avatar
    Derrick Petzold

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

  3. Tom Avatar
    Tom

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

  4. Sherry Wei Avatar
    Sherry Wei

    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 Avatar
    Rossen

    Thanks so much!
    It is work very well!

  6. Alessandro Avatar
    Alessandro

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

  7. Alessandro Avatar
    Alessandro

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