Last active
October 6, 2020 13:14
-
-
Save Ruslan-Skira/ecb7c655826664b200fd91282745c92f to your computer and use it in GitHub Desktop.
orm_requests_loggs_django_settings
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
import logging.config | |
LOGGING_CONFIG = None | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'handlers': { | |
'console': { | |
'class': 'logging.StreamHandler', | |
'formatter': 'file_format', | |
}, | |
'file': { | |
'level': 'INFO', | |
'class': 'logging.FileHandler', | |
# create file before | |
'filename': '/home/user/Projects/linkedingame/namesgames/namesgames/debug.log', | |
'formatter': 'file_format', | |
}, | |
}, | |
'loggers': { | |
# root logger | |
'django': { | |
'handlers': ['console'], | |
'propagate': True, | |
#'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), | |
}, | |
# application user and views need to create | |
'user.views': { | |
'level': 'INFO', | |
'handlers': ['file', 'console'], | |
'propagate': False, | |
}, | |
'django.utils.autoreload': { | |
'level': 'WARNING', | |
'handlers': ['console'], | |
} | |
}, | |
'formatters': { | |
'file_format': { | |
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}', | |
'style': '{', | |
}, | |
} | |
} | |
logging.config.dictConfig(LOGGING) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment