Add log JSON formatter
This commit is contained in:
parent
4750d1c5ef
commit
3c99928a27
27 changed files with 402 additions and 41 deletions
|
@ -1,10 +1,12 @@
|
|||
from Crypto import Random
|
||||
from util.log import logfile_path
|
||||
|
||||
|
||||
logconfig = logfile_path(debug=True)
|
||||
bind = '0.0.0.0:5000'
|
||||
workers = 2
|
||||
worker_class = 'gevent'
|
||||
daemon = False
|
||||
logconfig = 'conf/logging_debug.conf'
|
||||
pythonpath = '.'
|
||||
preload_app = True
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from Crypto import Random
|
||||
from util.log import logfile_path
|
||||
|
||||
|
||||
logconfig = logfile_path(debug=False)
|
||||
bind = 'unix:/tmp/gunicorn_registry.sock'
|
||||
workers = 8
|
||||
worker_class = 'gevent'
|
||||
logconfig = 'conf/logging.conf'
|
||||
pythonpath = '.'
|
||||
preload_app = True
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
from Crypto import Random
|
||||
from util.log import logfile_path
|
||||
|
||||
|
||||
logconfig = logfile_path(debug=False)
|
||||
bind = 'unix:/tmp/gunicorn_secscan.sock'
|
||||
workers = 2
|
||||
worker_class = 'gevent'
|
||||
logconfig = 'conf/logging.conf'
|
||||
pythonpath = '.'
|
||||
preload_app = True
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
from Crypto import Random
|
||||
from util.log import logfile_path
|
||||
|
||||
|
||||
logconfig = logfile_path(debug=False)
|
||||
|
||||
bind = 'unix:/tmp/gunicorn_verbs.sock'
|
||||
workers = 4
|
||||
logconfig = 'conf/logging.conf'
|
||||
pythonpath = '.'
|
||||
preload_app = True
|
||||
timeout = 2000 # Because sync workers
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
from Crypto import Random
|
||||
from util.log import logfile_path
|
||||
|
||||
|
||||
logconfig = logfile_path(debug=False)
|
||||
|
||||
bind = 'unix:/tmp/gunicorn_web.sock'
|
||||
workers = 2
|
||||
worker_class = 'gevent'
|
||||
logconfig = 'conf/logging.conf'
|
||||
pythonpath = '.'
|
||||
preload_app = True
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[loggers]
|
||||
keys=root
|
||||
keys=root,gunicorn.error,gunicorn.access
|
||||
|
||||
[handlers]
|
||||
keys=console
|
||||
|
||||
[formatters]
|
||||
keys=generic
|
||||
keys=generic,json
|
||||
|
||||
[logger_root]
|
||||
level=INFO
|
||||
|
@ -19,3 +19,18 @@ args=(sys.stdout, )
|
|||
[formatter_generic]
|
||||
format=%(asctime)s [%(process)d] [%(levelname)s] [%(name)s] %(message)s
|
||||
class=logging.Formatter
|
||||
|
||||
[formatter_json]
|
||||
class=loghandler.JsonFormatter
|
||||
|
||||
[logger_gunicorn.error]
|
||||
level=ERROR
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.error
|
||||
|
||||
[logger_gunicorn.access]
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.access
|
||||
level=DEBUG
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[loggers]
|
||||
keys=root,boto
|
||||
keys=root,boto,gunicorn.error,gunicorn.access
|
||||
|
||||
[handlers]
|
||||
keys=console
|
||||
|
||||
[formatters]
|
||||
keys=generic
|
||||
keys=generic,json
|
||||
|
||||
[logger_root]
|
||||
level=DEBUG
|
||||
|
@ -16,11 +16,26 @@ level=INFO
|
|||
handlers=console
|
||||
qualname=boto
|
||||
|
||||
[logger_gunicorn.access]
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.access
|
||||
level=DEBUG
|
||||
|
||||
[handler_console]
|
||||
class=StreamHandler
|
||||
formatter=generic
|
||||
args=(sys.stdout, )
|
||||
|
||||
[logger_gunicorn.error]
|
||||
level=ERROR
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.error
|
||||
|
||||
[formatter_generic]
|
||||
format=%(asctime)s [%(process)d] [%(levelname)s] [%(name)s] %(message)s
|
||||
class=logging.Formatter
|
||||
|
||||
[formatter_json]
|
||||
class=loghandler.JsonFormatter
|
||||
|
|
41
conf/logging_debug_json.conf
Normal file
41
conf/logging_debug_json.conf
Normal file
|
@ -0,0 +1,41 @@
|
|||
[loggers]
|
||||
keys=root,boto,gunicorn.error,gunicorn.access
|
||||
|
||||
[handlers]
|
||||
keys=console
|
||||
|
||||
[formatters]
|
||||
keys=generic,json
|
||||
|
||||
[logger_root]
|
||||
level=DEBUG
|
||||
handlers=console
|
||||
|
||||
[logger_boto]
|
||||
level=INFO
|
||||
handlers=console
|
||||
qualname=boto
|
||||
|
||||
[logger_gunicorn.access]
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.access
|
||||
level=DEBUG
|
||||
|
||||
[handler_console]
|
||||
class=StreamHandler
|
||||
formatter=json
|
||||
args=(sys.stdout, )
|
||||
|
||||
[logger_gunicorn.error]
|
||||
level=ERROR
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.error
|
||||
|
||||
[formatter_generic]
|
||||
format=%(asctime)s [%(process)d] [%(levelname)s] [%(name)s] %(message)s
|
||||
class=logging.Formatter
|
||||
|
||||
[formatter_json]
|
||||
class=loghandler.JsonFormatter
|
36
conf/logging_json.conf
Normal file
36
conf/logging_json.conf
Normal file
|
@ -0,0 +1,36 @@
|
|||
[loggers]
|
||||
keys=root,gunicorn.error,gunicorn.access
|
||||
|
||||
[handlers]
|
||||
keys=console
|
||||
|
||||
[formatters]
|
||||
keys=json,generic
|
||||
|
||||
[logger_root]
|
||||
level=INFO
|
||||
handlers=console
|
||||
|
||||
[handler_console]
|
||||
class=StreamHandler
|
||||
formatter=json
|
||||
args=(sys.stdout, )
|
||||
|
||||
[formatter_generic]
|
||||
format=%(asctime)s [%(process)d] [%(levelname)s] [%(name)s] %(message)s
|
||||
class=logging.Formatter
|
||||
|
||||
[formatter_json]
|
||||
class=loghandler.JsonFormatter
|
||||
|
||||
[logger_gunicorn.error]
|
||||
level=ERROR
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.error
|
||||
|
||||
[logger_gunicorn.access]
|
||||
handlers=console
|
||||
propagate=0
|
||||
qualname=gunicorn.access
|
||||
level=DEBUG
|
Reference in a new issue