elastic / elastic/ecs-logging-python
Add an example on how to configure with dictConfig + StdlibFormatter
- Vorherrschende Sprache
- Python
- Sterne
- 74
- Forks
- 33
- Ø Merge
- 9 Std. 3 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
```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",
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.