我正在登录到syslog(在通往papertrail的路上),我希望在最终的日志中可以看到异常。你知道吗
使用普通配置,异常如下所示:
Sep 02 08:35:16 web1.stage.releng.webapp.scl3.mozilla.com relengapi: Exception on /tokenauth/tokens [POST]#012Traceback (most recent call last):#012 File "/data/www/relengapi/virtualenv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request#012 rv = self.dispatch_request()#012 File "/data/www/relengapi/virtualenv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request#012 return self.view_functions[rule.endpoint](**req.view_args)#012
也就是说,由#012分隔的一条很长的线。事实上,文书记录在完成之前就把它切断了。你知道吗
我想找到一种方法,将该异常拆分为多行。我愿意monkeypatch或子类日志模块这样做,但我找不到一个好地方。你知道吗
这里的最佳做法是什么?你知道吗
以下似乎起到了作用:
但是我不喜欢使用
logging._defaultFormatter
。有更好的办法吗?你知道吗相关问题 更多 >
编程相关推荐