elastic / elastic/ecs-logging-python

Add an example on how to configure with dictConfig + StdlibFormatter

Đang mở
#12 0 bình luận 9 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
74
Fork
33
Merge trung bình
9 giờ 3 phút
Pull request đã merge (30 ngày)
1

Mô tả

```python
LOGGING_CONFIG = {
"format": "[%(asctime)s.%(msecs)03d] %(levelname)s %(name)s:%(funcName)s: %(message)s",
"datefmt": "%d/%b/%Y:%H:%M:%S",
},
+ "ecs": {
+ "()": "ecs_logging.StdlibFormatter"
+ },
"access": {"format": "%(message)s",},
},
"handlers": {
"default": {
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
- "formatter": "default",
+ "formatter": "ecs",
},
"access_logs": {
"class": "logging.StreamHandler",
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.