Skip to content

Instantly share code, notes, and snippets.

@briggleman
Last active July 24, 2020 17:24
Show Gist options
  • Save briggleman/e3db8ee552efe1b5c79044ad024a53e6 to your computer and use it in GitHub Desktop.
Save briggleman/e3db8ee552efe1b5c79044ad024a53e6 to your computer and use it in GitHub Desktop.
---
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
colored:
(): "colorlog.ColoredFormatter"
datefmt: "%Y-%m-%d %H:%M:%S"
format: "%(white)s%(asctime)s.%(msecs)03d%(reset)s - %(cyan)s[%(module)s.%(funcName)s]%(reset)s - %(log_color)s[%(levelname)s] :=>%(reset)s %(message)s"
log_colors:
DEBUG: purple
INFO: blue
WARNING: yellow
ERROR: red
CRITICAL: red,bg_white
sanic:
(): "colorlog.ColoredFormatter"
datefmt: "%Y-%m-%d %H:%M:%S"
format: "%(white)s%(asctime)s.%(msecs)03d%(reset)s - %(cyan)s[%(host)s]%(reset)s - %(log_color)s[%(levelname)s] :=>%(reset)s %(request)s %(status)s"
log_colors:
DEBUG: purple
INFO: blue
WARNING: yellow
ERROR: red
CRITICAL: red,bg_white
handlers:
console:
class: logging.StreamHandler
level: DEBUG
formatter: colored
stream: ext://sys.stdout
sanic:
class: logging.StreamHandler
level: INFO
formatter: sanic
stream: ext://sys.stdout
loggers:
reward:
level: ${DEBUG_LEVEL}
handlers: [console]
sanic.access:
level: INFO
handlers: [sanic]
sanic.root:
level: INFO
handlers: [console]
root:
level: DEBUG
handlers: [console]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment