Last active
June 10, 2020 17:05
-
-
Save pollenjp/6f814ded2c9bf5b5fd44acb152d845b1 to your computer and use it in GitHub Desktop.
logging.conf.yml サンプル
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
# https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema | |
version: 1 | |
formatters: | |
console_formatter: | |
# https://docs.python.org/ja/3/howto/logging.html#logging.logging.Formatter.__init__ | |
format: "%(asctime)s | %(name)20s | %(levelname)10s | %(threadName)8s | %(filename)20s:%(lineno)4d | %(message)s" | |
file_formatter: | |
format: "%(asctime)s | %(name)20s | %(levelname)10s | %(threadName)8s | %(filename)20s:%(lineno)4d | %(message)s" | |
handlers: | |
console_handler: | |
class: logging.StreamHandler | |
level: INFO | |
formatter: console_formatter | |
file_handler: | |
class: logging.handlers.RotatingFileHandler | |
filename: "app.log" | |
mode: "a" | |
maxBytes: 52428800 # 50 * 1024 * 1024 | |
backupCount: 100 | |
encoding: "utf-8" | |
level: DEBUG | |
formatter: file_formatter | |
# loggers: | |
root: | |
level: DEBUG | |
handlers: | |
- console_handler | |
- file_handler | |
disable_existing_loggers: False # https://qiita.com/propella/items/5ad25eca11de2a871a06 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment