forked from Antyfreezze/monefy-web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
27 lines (23 loc) · 905 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Configuration for Sanic Application"""
import os
from sanic.log import LOGGING_CONFIG_DEFAULTS
os.makedirs(name="logs", exist_ok=True)
LOGGING_CONFIG_CUSTOM = LOGGING_CONFIG_DEFAULTS
LOGGING_CONFIG_CUSTOM["handlers"]["internalFile"] = {
"class": "logging.FileHandler",
"formatter": "generic",
"filename": "logs/monefy_app.log",
}
LOGGING_CONFIG_CUSTOM["handlers"]["accessFile"] = {
"class": "logging.FileHandler",
"formatter": "access",
"filename": "logs/monefy_app.log",
}
LOGGING_CONFIG_CUSTOM["handlers"]["errorFile"] = {
"class": "logging.FileHandler",
"formatter": "generic",
"filename": "logs/monefy_app.log",
}
LOGGING_CONFIG_CUSTOM["loggers"]["sanic.root"]["handlers"].append("internalFile")
LOGGING_CONFIG_CUSTOM["loggers"]["sanic.error"]["handlers"].append("errorFile")
LOGGING_CONFIG_CUSTOM["loggers"]["sanic.access"]["handlers"].append("accessFile")