logging: don't use TimedRotatingFileHandler anymore

Replace it by entrouvert.logging.handlers.SysLogHandler
This commit is contained in:
Jérôme Schneider 2014-05-28 09:46:53 +02:00
parent 4c23c8abf3
commit 52f95e9765
4 changed files with 13 additions and 31 deletions

View File

@ -38,23 +38,12 @@ LOGGING = {
'class': 'logging.StreamHandler',
'formatter': 'console'
},
'rotate_file': {
'level': 'INFO',
'class': 'logging.handlers.TimedRotatingFileHandler',
'formatter': 'file',
'filename': os.path.join(_PROJECT_PATH, 'mandaye.log'),
# W[0-6] : weekly (0: Monday), D: day, ... (python doc)
'when': 'W6',
# Every week
'interval': 1,
# BackupCount (keep one year of log)
'backupCount': 52
},
'syslog': {
'level': 'INFO',
'class': 'logging.handlers.SysLogHandler',
'class': 'entrouvert.logging.handlers.SysLogHandler',
'formatter': 'file',
'address': '/dev/log'
'address': '/dev/log',
'max_length': 999,
},
},
'loggers': {
@ -64,7 +53,7 @@ LOGGING = {
'propagate': False,
},
'mandaye': {
'handlers': ['console', 'rotate_file'],
'handlers': ['console', 'syslog'],
'level': 'DEBUG',
'propagate': False,
},

View File

@ -33,21 +33,9 @@ LOGGING = {{
'class': 'logging.StreamHandler',
'formatter': 'console'
}},
'rotate_file': {{
'level': 'INFO',
'class': 'logging.handlers.TimedRotatingFileHandler',
'formatter': 'file',
'filename': os.path.join(_PROJECT_PATH, '{project_name}.log'),
# W[0-6] : weekly (0: Monday), D: day, ... (python doc)
'when': 'W6',
# Every week
'interval': 1,
# BackupCount (keep one year of log)
'backupCount': 52
}},
'syslog': {{
'level': 'INFO',
'class': 'logging.handlers.SysLogHandler',
'class': 'entrouvert.logging.handlers.SysLogHandler',
'formatter': 'file',
'address': '/dev/log'
}},
@ -59,12 +47,12 @@ LOGGING = {{
'propagate': False,
}},
'mandaye': {{
'handlers': ['console', 'rotate_file'],
'handlers': ['console', 'syslog'],
'level': 'DEBUG',
'propagate': False,
}},
'{project_name}': {{
'handlers': ['console', 'rotate_file'],
'handlers': ['console', 'syslog'],
'level': 'DEBUG',
'propagate': False,
}},

View File

@ -1,3 +1,5 @@
python-entrouvert
-f https://repos.entrouvert.org/python-entrouvert.git/
beaker>=1.6
pycrypto>=2.0
lxml>=2.0

View File

@ -49,6 +49,9 @@ setup(name="mandaye",
scripts=['scripts/mandaye-admin.py'],
include_package_data = True,
packages=find_packages(),
install_requires=install_requires
install_requires=install_requires,
dependency_links = [
'git+git://repos.entrouvert.org/python-entrouvert.git/#egg=python-entrouvert-9999.0',
],
)