Skip to content

Instantly share code, notes, and snippets.

@shentonfreude
Created September 20, 2017 19:24
Show Gist options
  • Save shentonfreude/44a47d2721b322d15f28d6e2445f9e0e to your computer and use it in GitHub Desktop.
Save shentonfreude/44a47d2721b322d15f28d6e2445f9e0e to your computer and use it in GitHub Desktop.
AWS boto debug logging config suggested by AWS
import boto3
import botocore
from time import gmtime, strftime
FORMAT = "[%(levelname)s %(asctime)s %(filename)s:%(lineno)s - %(funcName)21s() ] %(message)s"
DATEFMT= strftime("%%Y%m%dT%H%M%SZ", gmtime()) logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt=DATEFMT)
logger = logging.getLogger(__name__)
boto3_log = logging.getLogger("boto3")
boto3_log.setLevel(logging.DEBUG)
boto3_log.propagate = True
botocore_log = logging.getLogger("botocore")
botocore_log.setLevel(logging.DEBUG)
botocore_log.propagate = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment