Commit 68c2e26f authored by zhanglu's avatar zhanglu

添加敏感词日志

parent db6692de
......@@ -2,6 +2,7 @@
from engine.rpc import get_current_rpc_invoker
from engine.logger import sensitive_logger
from libs.spawn_task import SpawnTask, Task
......@@ -41,6 +42,9 @@ class Sensitive(object):
except:
res = None
sensitive_logger.info(text)
sensitive_logger.info(res)
return res
@classmethod
......
......@@ -27,6 +27,8 @@ exception_logger = logging.getLogger('exception_logger')
cpc_click_consumer_logger = logging.getLogger('cpc_click_consumer_logger')
auth_logger = logging.getLogger('auth_logger')
wechat_logger = logging.getLogger('wechat_logger')
sensitive_logger = logging.getLogger('sensitive_logger')
def debug(view_func):
"""将POST请求数据存到log
......
......@@ -92,6 +92,13 @@ LOGGING = {
'interval': 1,
'backupCount': 30,
},
'sensitive_handler': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_DIR, 'sensitive.log'),
'formatter': 'profile',
'maxBytes': 500 * 1024 * 1024, # 500M
},
},
'loggers': {
......@@ -143,6 +150,11 @@ LOGGING = {
'propagate': False,
'level': 'INFO'
},
'sensitive_logger': {
'handlers': ['sensitive_handler'],
'propagate': False,
'level': 'INFO'
},
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment