Revamp the logging a bit. Not quite done yet.
This commit is contained in:
parent
3fb4fafb33
commit
a5a61576ae
10 changed files with 91 additions and 52 deletions
|
@ -3,7 +3,5 @@ workers = 8
|
|||
worker_class = 'gevent'
|
||||
timeout = 2000
|
||||
pidfile = '/tmp/gunicorn.pid'
|
||||
errorlog = '/mnt/logs/application.log'
|
||||
loglevel = 'debug'
|
||||
logger_class = 'util.glogger.LogstashLogger'
|
||||
logconfig = 'conf/logging.conf'
|
||||
pythonpath = '.'
|
|
@ -3,7 +3,5 @@ workers = 2
|
|||
worker_class = 'gevent'
|
||||
timeout = 2000
|
||||
daemon = False
|
||||
errorlog = '-'
|
||||
loglevel = 'debug'
|
||||
logger_class = 'util.glogger.LogstashLogger'
|
||||
logconfig = 'conf/logging_local.conf'
|
||||
pythonpath = '.'
|
39
conf/logging.conf
Normal file
39
conf/logging.conf
Normal file
|
@ -0,0 +1,39 @@
|
|||
[loggers]
|
||||
keys=root, gunicorn.error, gunicorn.access
|
||||
|
||||
[handlers]
|
||||
keys=error_file
|
||||
|
||||
[formatters]
|
||||
keys=generic
|
||||
|
||||
[logger_application.profiler]
|
||||
level=DEBUG
|
||||
handlers=error_file
|
||||
propagate=0
|
||||
qualname=application.profiler
|
||||
|
||||
[logger_root]
|
||||
level=DEBUG
|
||||
handlers=error_file
|
||||
|
||||
[logger_gunicorn.error]
|
||||
level=INFO
|
||||
handlers=error_file
|
||||
propagate=1
|
||||
qualname=gunicorn.error
|
||||
|
||||
[logger_gunicorn.access]
|
||||
level=INFO
|
||||
handlers=error_file
|
||||
propagate=0
|
||||
qualname=gunicorn.access
|
||||
|
||||
[handler_error_file]
|
||||
class=logging.FileHandler
|
||||
formatter=generic
|
||||
args=('/mnt/logs/application.log',)
|
||||
|
||||
[formatter_generic]
|
||||
format=%(asctime)s [%(process)d] [%(levelname)s] %(message)s
|
||||
class=logging.Formatter
|
39
conf/logging_local.conf
Normal file
39
conf/logging_local.conf
Normal file
|
@ -0,0 +1,39 @@
|
|||
[loggers]
|
||||
keys=root, gunicorn.error, gunicorn.access, application.profiler
|
||||
|
||||
[handlers]
|
||||
keys=console
|
||||
|
||||
[formatters]
|
||||
keys=generic
|
||||
|
||||
[logger_application.profiler]
|
||||
level=DEBUG
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=application.profiler
|
||||
|
||||
[logger_root]
|
||||
level=DEBUG
|
||||
handlers=console
|
||||
|
||||
[logger_gunicorn.error]
|
||||
level=INFO
|
||||
handlers=console
|
||||
propagate=1
|
||||
qualname=gunicorn.error
|
||||
|
||||
[logger_gunicorn.access]
|
||||
level=INFO
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.access
|
||||
|
||||
[handler_console]
|
||||
class=StreamHandler
|
||||
formatter=generic
|
||||
args=(sys.stdout, )
|
||||
|
||||
[formatter_generic]
|
||||
format=%(asctime)s [%(process)d] [%(levelname)s] %(message)s
|
||||
class=logging.Formatter
|
Reference in a new issue