gsi*_*nha 5 python google-app-engine python-2.7
在日志中,时间戳可用,但是"source file name"并"line number"不会记录每条日志消息.
如何在GAE Python的日志文件名和行号logging.info(或logging.warn或logging.error和其他)?
通过"source file name",我的意思是它产生的日志Python代码文件(*的.py).
您是否尝试过查看日志格式化程序?
它应该看起来像这样
formatter = logging.Formatter(
'[%(asctime)s] p%(process)s {%(pathname)s:%(lineno)d}'
' %(levelname)s - %(message)s','%m-%d %H:%M:%S')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
158 次 |
| 最近记录: |