https://github.com/hantmac/python_log_json
python 的logging模块实现json格式的日志输出
https://github.com/hantmac/python_log_json
Last synced: 5 months ago
JSON representation
python 的logging模块实现json格式的日志输出
- Host: GitHub
- URL: https://github.com/hantmac/python_log_json
- Owner: hantmac
- Created: 2018-10-27T06:31:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-27T06:40:50.000Z (about 7 years ago)
- Last Synced: 2025-03-12T00:30:41.457Z (10 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Python实现json格式的日志输出
- 使用时,from xxx import get_logger
- 可自定义日志formater,日志输出路径
- 测试的结果,可以在./log/xxx.log文件中看到输出的日志
- 例如:{"asctime": "2018-09-28 09:52:12,622", "threadName": "MainThread", "thread": 4338656704, "name": "proxyCheck", "levelname": "ERROR", "%(lineno": null, "module": "mylog", "funcName": "test", "message": "division by zero"}