Created
June 7, 2013 15:38
-
-
Save anonymous/5730195 to your computer and use it in GitHub Desktop.
dev log setting
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
########### | |
# LOGGING # | |
########### | |
# port of django logger w/ enhancement | |
# @see | |
# http://docs.python.org/2/library/logging.config.html#logging-config-dictschema | |
LOGGING = { | |
'version': 1, # only valid version @ present | |
'disable_existing_loggers': False, | |
'filters': { | |
'require_debug_false': { | |
'()': 'django.utils.log.RequireDebugFalse', | |
} | |
}, | |
'formatters': { | |
'standard': { | |
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s' | |
}, | |
'verbose': { | |
#'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' | |
'format': '%(levelname)s -(%(name)s)- %(asctime)s %(module)s %(message)s' | |
}, | |
'hardcore': { | |
# thread debug | |
'format': '%(levelname)s %(asctime)s %(module)s [%(lineno)d] %(process)d %(thread)d %(message)s' | |
} | |
}, | |
'handlers': { | |
'mail_admins': { | |
# only available on debug false | |
'level': 'ERROR', | |
'filters': ['require_debug_false'], | |
'class': 'django.utils.log.AdminEmailHandler' | |
}, | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', # stderr | |
'formatter': 'verbose' | |
}, | |
'null': { | |
# throw it out | |
'level': 'DEBUG', | |
'class': 'django.utils.log.NullHandler', | |
} | |
}, | |
'loggers': { | |
# in any module of app, call getlogger(__name__) | |
'app': { | |
'handlers': ['console'], | |
'propagate': True, | |
'level': 'DEBUG' | |
}, | |
'epht': { | |
'handlers': ['console'], | |
'propagate': True, | |
'level': 'DEBUG' | |
}, | |
'app.epht.lib.wms': { | |
'handlers': ['null'], | |
'propagate': False, | |
'level': 'DEBUG' | |
}, | |
# django only logs msg | |
'django.request': { | |
'handlers': ['mail_admins'], | |
'level': 'ERROR', | |
'propagate': True, | |
}, | |
'epht.management.commands': { | |
'handlers': ['console'], | |
'propagate': True, | |
'level': 'ERROR', | |
} | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment