diff --git a/bookkeeper-benchmark/conf/log4j2.xml b/bookkeeper-benchmark/conf/log4j2.xml index 21257d6dc3a..e89054596ec 100644 --- a/bookkeeper-benchmark/conf/log4j2.xml +++ b/bookkeeper-benchmark/conf/log4j2.xml @@ -22,13 +22,13 @@ - + - + - + diff --git a/bookkeeper-server/src/main/resources/log4j2.xml b/bookkeeper-server/src/main/resources/log4j2.xml index 3e3e4bc8c8e..b67f9faa5dd 100644 --- a/bookkeeper-server/src/main/resources/log4j2.xml +++ b/bookkeeper-server/src/main/resources/log4j2.xml @@ -22,7 +22,7 @@ - + diff --git a/conf/log4j2.cli.xml b/conf/log4j2.cli.xml index 3a1d2fa4ffb..6f2b2bf1b73 100644 --- a/conf/log4j2.cli.xml +++ b/conf/log4j2.cli.xml @@ -34,7 +34,7 @@ - + diff --git a/conf/log4j2.otel-json.xml b/conf/log4j2.otel-json.xml new file mode 100644 index 00000000000..a6df4c47358 --- /dev/null +++ b/conf/log4j2.otel-json.xml @@ -0,0 +1,86 @@ + + + + + + . + bookkeeper-server.json.log + INFO + CONSOLE + file:${sys:bookkeeper.conf.dir:-conf}/otel-log-template.json + + + + + + + + + + + + + + + + + + + + diff --git a/conf/log4j2.shell.xml b/conf/log4j2.shell.xml index c6e6b0fb9cd..563149697ac 100644 --- a/conf/log4j2.shell.xml +++ b/conf/log4j2.shell.xml @@ -31,7 +31,7 @@ - + diff --git a/conf/log4j2.xml b/conf/log4j2.xml index 08d5d5613c1..8aed8f0dab8 100644 --- a/conf/log4j2.xml +++ b/conf/log4j2.xml @@ -27,27 +27,21 @@ CONSOLE + - - - - + - - - - + - - - - - - - - + @@ -58,8 +52,5 @@ - - - diff --git a/conf/otel-log-template.json b/conf/otel-log-template.json new file mode 100644 index 00000000000..d3e8e95f856 --- /dev/null +++ b/conf/otel-log-template.json @@ -0,0 +1,63 @@ +{ + "Timestamp": { + "$resolver": "timestamp", + "pattern": { + "format": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", + "timeZone": "UTC" + } + }, + "SeverityText": { + "$resolver": "level", + "field": "name" + }, + "Body": { + "$resolver": "message", + "stringified": true + }, + "TraceId": { + "$resolver": "mdc", + "key": "trace_id" + }, + "SpanId": { + "$resolver": "mdc", + "key": "span_id" + }, + "TraceFlags": { + "$resolver": "mdc", + "key": "trace_flags" + }, + "Attributes": { + "thread.name": { + "$resolver": "thread", + "field": "name" + }, + "thread.id": { + "$resolver": "thread", + "field": "id" + }, + "code.namespace": { + "$resolver": "logger", + "field": "name" + }, + "exception.type": { + "$resolver": "exception", + "field": "className" + }, + "exception.message": { + "$resolver": "exception", + "field": "message" + }, + "exception.stacktrace": { + "$resolver": "exception", + "field": "stackTrace", + "stackTrace": { + "stringified": true + } + }, + "mdc": { + "$resolver": "mdc", + "flatten": true, + "stringified": true + } + } +} diff --git a/stream/conf/log4j2.cli.xml b/stream/conf/log4j2.cli.xml index 8c625013923..e29f7331281 100644 --- a/stream/conf/log4j2.cli.xml +++ b/stream/conf/log4j2.cli.xml @@ -28,13 +28,13 @@ - + - + - + diff --git a/stream/conf/log4j2.xml b/stream/conf/log4j2.xml index 006e4bf6975..fd16c99e490 100644 --- a/stream/conf/log4j2.xml +++ b/stream/conf/log4j2.xml @@ -28,13 +28,13 @@ - + - + - +