Created
December 30, 2017 04:49
-
-
Save pavan538/a47a675b29735633c93bb0f9b2992b75 to your computer and use it in GitHub Desktop.
python logging dict config example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logconfig = { | |
"version": 1, | |
"disable_existing_loggers": 0, | |
"root": { | |
"level": "DEBUG", | |
"handlers": [ | |
"console", | |
"file", | |
"debugfile" | |
] | |
}, | |
"loggers": { | |
}, | |
"formatters": { | |
"precise": { | |
"format": "%(asctime)s %(name)-15s %(levelname)-8s %(message)s" | |
}, | |
"brief": { | |
"format": "%(levelname)-8s: %(name)-15s: %(message)s" | |
} | |
}, | |
"handlers": { | |
"debugfile": { | |
"class": "logging.FileHandler", | |
"formatter": "precise", | |
"mode": "a", | |
"level": "DEBUG", | |
"filename": "log/debug.log" | |
}, | |
"console": { | |
"formatter": "precise", | |
"class": "logging.StreamHandler", | |
"stream": "ext://sys.stdout", | |
"level": "DEBUG" | |
}, | |
"file": { | |
"formatter": "precise", | |
"backupCount": 3, | |
"level": "WARNING", | |
"maxBytes": 10240000, | |
"class": "logging.handlers.RotatingFileHandler", | |
"filename": "log/rotate.log" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment