Ignore logging of ldapserver /ping route

This commit is contained in:
Tanner Collin 2020-11-12 23:38:24 +00:00
parent 19e2d250de
commit 3f4cd0e3f5

View File

@ -1,6 +1,10 @@
import logging
import logging.config
class IgnorePing(logging.Filter):
def filter(self, record):
return 'GET /ping' not in record.getMessage()
LOG_DICT = {
'version': 1,
'formatters': {
@ -8,19 +12,27 @@ LOG_DICT = {
'format': '[%(asctime)s] [%(process)d] [%(levelname)7s] %(message)s',
},
},
'filters': {
'ignore_ping': {
'()': 'log.IgnorePing',
},
},
'handlers': {
'wsgi': {
'class': 'logging.StreamHandler',
'filters': ['ignore_ping'],
'stream': 'ext://flask.logging.wsgi_errors_stream',
'formatter': 'default'
},
'console': {
'level': 'DEBUG',
'filters': ['ignore_ping'],
'class': 'logging.StreamHandler',
'formatter': 'default'
},
'null': {
'level': 'DEBUG',
'filters': ['ignore_ping'],
'class': 'logging.NullHandler',
'formatter': 'default'
},