Стартавая модель авторизации в приложении
This commit is contained in:
49
config/logging.py
Normal file
49
config/logging.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import os
|
||||
from config.local_settings import LOGS_DIR
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'formatters': {
|
||||
'verbose': {
|
||||
'format': '{asctime} {levelname} {module} {process:d} {thread:d} '
|
||||
'{message}',
|
||||
'style': '{',
|
||||
},
|
||||
'simple': {
|
||||
'format': '{asctime} {levelname} {message}',
|
||||
'style': '{',
|
||||
},
|
||||
}, # formatters
|
||||
'handlers': {
|
||||
'console': {
|
||||
'level': 'DEBUG',
|
||||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'simple',
|
||||
},
|
||||
'file': {
|
||||
'level': 'DEBUG',
|
||||
'formatter': 'verbose',
|
||||
'class': 'logging.handlers.TimedRotatingFileHandler',
|
||||
'filename': os.path.join(LOGS_DIR, "debug.log"),
|
||||
'when': 'midnight',
|
||||
'backupCount': 30,
|
||||
},
|
||||
}, # handlers
|
||||
'loggers': {
|
||||
'': { # root logger
|
||||
'handlers': ['console', 'file'],
|
||||
'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO').upper(),
|
||||
},
|
||||
'customauth': {
|
||||
'handlers': ['console', 'file'],
|
||||
'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG').upper(),
|
||||
'propagate': False, # required to eliminate duplication on root
|
||||
},
|
||||
# 'app_name': {
|
||||
# 'handlers': ['console', 'file'],
|
||||
# 'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG').upper(),
|
||||
# 'propagate': False, # required to eliminate duplication on root
|
||||
# },
|
||||
}, # loggers
|
||||
} # logging
|
||||
Reference in New Issue
Block a user