airbytehq / airbytehq/airbyte

Stack traces are logged as arrays when using json logging

Open
#76,438 3 comments 0 reactions 0 assignees View on GitHub
autoteam community needs-triage team/use
Dominant language
Python
Stars
22.1k
Forks
5.3k
PR merge metrics
PR metrics pending

Description

### Topic

Stack traces are logged as arrays when using json logging

### Relevant information

When using JSON logging `PLATFORM_LOG_FORMAT=json`, stack traces are logged as array.
Example below.

This makes it painful when shipping logs to, for example, ELK. Elastic encoders wraps the exception on a single text field and formats it very nicely with `\n\t`. Perhaps the same could be done here.

````
{
"timestamp": 1776265131936,
"message": "Failed to obtain or add access token",
"level": "ERROR",
"logSource": "platform",
"caller": {
"className": "io.airbyte.api.client.auth.AccessTokenInterceptor",
"methodName": "intercept",
"lineNumber": 120,
"threadName": "main"
},
"throwable": {
"cause": {
"cause": null,
"stackTrace": [
{
"cn": "sun.nio.ch.Net",
"ln": -2,
"mn": "pollConnect"
},
{
"cn": "sun.nio.ch.Net",
"ln": 682,
"mn": "pollConnectNow"
},
{
"cn": "sun.nio.ch.NioSocketImpl",
"ln": 549,
"mn": "timedFinishConnect"
},
{
"cn": "sun.nio.ch.NioSocketImpl",
"ln": 592,
"mn": "connect"
},
... omitted for brevity
],
"message": "Failed to connect to airbyte-airbyte-server-svc.airbyte/10.96.48.101:8001",
"suppressed": [],
"localizedMessage": "Failed to connect to airbyte-airbyte-server-svc.airbyte/10.96.48.101:8001"
}
}
```

---
**Internal Tracking:** https://github.com/airbytehq/oncall/issues/12002

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.