Last active
December 16, 2015 20:08
-
-
Save shchemelevev/5489737 to your computer and use it in GitHub Desktop.
Now you can use logger.info('text') format to log something.
I think this is best practice.
This logger will format output for nice reading.
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 = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'verbose': { | |
'format': '%(levelname)s %(asctime)s %(name)s %(funcName)s %(lineno)s: %(message)s' | |
}, | |
}, | |
'handlers': { | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
'formatter': 'verbose' | |
}, | |
'null': { | |
'level': 'DEBUG', | |
'class': 'django.utils.log.NullHandler', | |
}, | |
}, | |
'loggers': { | |
'django': { | |
'handlers': ['null'], | |
'propagate': False, | |
'level': 'DEBUG', | |
}, | |
'south': { | |
'handlers': ['console'], | |
'level': 'INFO', | |
'propagate': False, | |
}, | |
#'mutual_help.views': { #uncomment block to enable log in only one application | |
# 'handlers': ['console'], | |
# 'level': 'DEBUG', | |
# 'propagate': False, | |
#}, | |
'': { | |
'handlers': ['console'], | |
'level': 'WARNING', #or set level DEBUG to enable debug messages from all applications | |
'propagate': False, | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment