Created
March 6, 2018 16:48
-
-
Save hbruno/2d560a8246828ee0d484f3e494341304 to your computer and use it in GitHub Desktop.
Logging configuration
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 characters
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'verbose': { | |
'format': '%(levelname)s %(asctime)s %(module)s ' | |
'%(process)d %(thread)d %(message)s' | |
}, | |
'simple': { | |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' | |
}, | |
}, | |
'handlers': { | |
... | |
'migration': { | |
'class': 'logging.handlers.RotatingFileHandler', | |
'filename': str(ROOT_DIR.path('migration.log')), | |
'maxBytes': 1024*1024*5, # 5MB | |
'backupCount': 10, | |
'formatter': 'simple' | |
}, | |
'command': { | |
'class': 'logging.handlers.RotatingFileHandler', | |
'filename': str(ROOT_DIR.path('command.log')), | |
'maxBytes': 1024*1024*5, # 5MB | |
'backupCount': 10, | |
'formatter': 'simple' | |
}, | |
}, | |
'loggers': { | |
... | |
'migrations': { | |
'handlers': ['migration', 'console'], | |
'level': 'DEBUG', | |
'propagate': True | |
}, | |
'commands': { | |
'handlers': ['command'], | |
'level': 'INFO', | |
'propagate': True | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment