elastic / elastic/ecs-logging-python

Add an example on how to configure with dictConfig + StdlibFormatter

オープン
#12 コメント 0 件 リアクション 9 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
74
フォーク
33
平均マージ
9時間 3分
マージ済み PR(30日)
1

説明

```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",
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。