Add logging config
This commit is contained in:
parent
58fda689bf
commit
8cc32be33f
1 changed files with 34 additions and 0 deletions
|
@ -126,3 +126,37 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
DATABASE_ROUTERS = [
|
DATABASE_ROUTERS = [
|
||||||
"yamdl.router.YamdlRouter",
|
"yamdl.router.YamdlRouter",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
LOGGING = {
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": False,
|
||||||
|
"handlers": {
|
||||||
|
"console": {
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
"formatter": "verbose"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"formatters": {
|
||||||
|
"verbose": {
|
||||||
|
# Mostly copied from gunicorn
|
||||||
|
"format": "%(asctime)s [%(process)d] [%(name)s] [%(levelname)s] %(message)s",
|
||||||
|
"datefmt": "[%Y-%m-%d %H:%M:%S %z]",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"handlers": ["console"],
|
||||||
|
"level": "WARNING",
|
||||||
|
},
|
||||||
|
"loggers": {
|
||||||
|
"django": {
|
||||||
|
"handlers": ["console"],
|
||||||
|
"level": "INFO",
|
||||||
|
"propagate": False,
|
||||||
|
},
|
||||||
|
"yamdl": {
|
||||||
|
"handlers": ["console"],
|
||||||
|
"level": "INFO",
|
||||||
|
"propagate": False,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue