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.

2 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 :).

Leave a Reply