1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

Added logging

This commit is contained in:
zhengxie
2012-12-27 20:48:38 +08:00
parent 47616acb1f
commit e24c8fb1bb
2 changed files with 48 additions and 0 deletions

4
logs/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@@ -211,6 +211,49 @@ SEAFILE_VERSION = '1.3.0'
USE_SUBDOMAIN = False
# Logging
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
},
'handlers': {
'default': {
'level':'WARN',
'class':'logging.handlers.RotatingFileHandler',
'filename': 'logs/seahub.log',
'maxBytes': 1024*1024*10, # 10 MB
'formatter':'standard',
},
'request_handler': {
'level':'WARN',
'class':'logging.handlers.RotatingFileHandler',
'filename': 'logs/django_request.log',
'maxBytes': 1024*1024*10, # 10 MB
'formatter':'standard',
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'': {
'handlers': ['default'],
'level': 'WARN',
'propagate': True
},
'django.request': {
'handlers': ['request_handler', 'mail_admins'],
'level': 'WARN',
'propagate': False
},
}
}
def load_local_settings(module):
'''Import any symbols that begin with A-Z. Append to lists any symbols
that begin with "EXTRA_".
@@ -254,3 +297,4 @@ else:
# Remove install_topdir from path
sys.path.pop(0)