-
-
Save nicolascine/e84f67d49fc7264946f3 to your computer and use it in GitHub Desktop.
Revisions
-
st4lk revised this gist
Jul 21, 2015 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ 'formatters': { 'main_formatter': { 'format': '%(levelname)s:%(name)s: %(message)s ' '(%(asctime)s; %(filename)s:%(lineno)d)', 'datefmt': "%Y-%m-%d %H:%M:%S", }, }, @@ -33,27 +33,27 @@ 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' }, 'console': { 'level': 'DEBUG', 'filters': ['require_debug_true'], 'class': 'logging.StreamHandler', 'formatter': 'main_formatter', }, 'production_file': { 'level': 'INFO', 'class': 'logging.handlers.RotatingFileHandler', 'filename': 'logs/main.log', 'maxBytes': 1024 * 1024 * 5, # 5 MB 'backupCount': 7, 'formatter': 'main_formatter', 'filters': ['require_debug_false'], }, 'debug_file': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', 'filename': 'logs/main_debug.log', 'maxBytes': 1024 * 1024 * 5, # 5 MB 'backupCount': 7, 'formatter': 'main_formatter', 'filters': ['require_debug_true'], }, @@ -78,4 +78,4 @@ 'level': "DEBUG", }, } } -
st4lk revised this gist
Jan 17, 2014 . 1 changed file with 4 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -41,20 +41,18 @@ }, 'production_file':{ 'level' : 'INFO', 'class' : 'logging.handlers.RotatingFileHandler', 'filename' : 'logs/main.log', 'maxBytes': 1024*1024*5, # 5 MB 'backupCount' : 7, 'formatter': 'main_formatter', 'filters': ['require_debug_false'], }, 'debug_file':{ 'level' : 'DEBUG', 'class' : 'logging.handlers.RotatingFileHandler', 'filename' : 'logs/main_debug.log', 'maxBytes': 1024*1024*5, # 5 MB 'backupCount' : 7, 'formatter': 'main_formatter', 'filters': ['require_debug_true'], -
st4lk revised this gist
Sep 27, 2013 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -59,6 +59,9 @@ 'formatter': 'main_formatter', 'filters': ['require_debug_true'], }, 'null': { "class": 'django.utils.log.NullHandler', } }, 'loggers': { 'django.request': { @@ -67,10 +70,10 @@ 'propagate': True, }, 'django': { 'handlers': ['null', ], }, 'py.warnings': { 'handlers': ['null', ], }, '': { 'handlers': ['console', 'production_file', 'debug_file'], -
st4lk revised this gist
Sep 27, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Logging settings for django projects, works with django 1.5+ # If DEBUG=True, all logs (including django logs) will be # written to console and to debug_file. # If DEBUG=False, logs with level INFO or higher will be -
st4lk renamed this gist
Sep 27, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
st4lk created this gist
Sep 27, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,80 @@ # Logging settings for django projects # If DEBUG=True, all logs (including django logs) will be # written to console and to debug_file. # If DEBUG=False, logs with level INFO or higher will be # saved to production_file. # Logging usage: # import logging # logger = logging.getLogger(__name__) # logger.info("Log this message") LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' }, 'require_debug_true': { '()': 'django.utils.log.RequireDebugTrue' } }, 'formatters': { 'main_formatter': { 'format': '%(levelname)s:%(name)s: %(message)s ' '(%(asctime)s; %(filename)s:%(lineno)d)', 'datefmt': "%Y-%m-%d %H:%M:%S", }, }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' }, 'console':{ 'level': 'DEBUG', 'filters': ['require_debug_true'], 'class': 'logging.StreamHandler', 'formatter': 'main_formatter', }, 'production_file':{ 'level' : 'INFO', 'class' : 'logging.handlers.TimedRotatingFileHandler', 'filename' : 'logs/main.log', 'when' : 'midnight', 'interval' : 1, 'backupCount' : 7, 'formatter': 'main_formatter', 'filters': ['require_debug_false'], }, 'debug_file':{ 'level' : 'DEBUG', 'class' : 'logging.handlers.TimedRotatingFileHandler', 'filename' : 'logs/main_debug.log', 'when' : 'midnight', 'interval' : 1, 'backupCount' : 7, 'formatter': 'main_formatter', 'filters': ['require_debug_true'], }, }, 'loggers': { 'django.request': { 'handlers': ['mail_admins', 'console'], 'level': 'ERROR', 'propagate': True, }, 'django': { 'handlers': [], }, 'py.warnings': { 'handlers': [], }, '': { 'handlers': ['console', 'production_file', 'debug_file'], 'level': "DEBUG", }, } }