elastic / elastic/ecs-logging-python

Add an example on how to configure with dictConfig + StdlibFormatter

Open
#12 0 comments 9 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
74
Forks
33
Avg merge
9h 3m
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.