elastic / elastic/ecs-logging-python

Disable `ensure_ascii` on `json.dumps`

Aperta
#170 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
agent-python community triage
Lingua principale
Python
Stelle
74
Fork
33
Merge medio
9h 3m
PR unite (30g)
1

Descrizione

Current output is unreadable in console if any language other than English is used in the messages.

Reproduction code:
```python
import logging
import ecs_logging

logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setFormatter(ecs_logging.StdlibFormatter())
logger.addHandler(handler)

logger.info("안녕하세요")
```

Expected output:
```json
{
"@timestamp": "2025-06-20T06:39:24.589Z",
"log.level": "info",
"message": "안녕하세요",
"ecs.version": "1.6.0",
"log": {
"logger": "root",
"origin": {
"file": { "line": 10, "name": "" },
"function": ""
},
"original": "안녕하세요"
},
"process": {
"name": "MainProcess",
"pid": 302584,
"thread": { "id": 140083028806592, "name": "MainThread" }
}
}
```

Received output:
```json
{
"@timestamp": "2025-06-20T06:39:24.589Z",
"log.level": "info",
"message": "\uc548\ub155\ud558\uc138\uc694",
"ecs.version": "1.6.0",
"log": {
"logger": "root",
"origin": {
"file": { "line": 10, "name": "" },
"function": ""
},
"original": "\uc548\ub155\ud558\uc138\uc694"
},
"process": {
"name": "MainProcess",
"pid": 302584,
"thread": { "id": 140083028806592, "name": "MainThread" }
}
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.