Skip to content

feat: support customization for MDC serializer #16

feat: support customization for MDC serializer

feat: support customization for MDC serializer #16

GitHub Actions / Test Report succeeded Apr 9, 2025 in 0s

259 passed, 0 failed and 0 skipped

Tests passed successfully

Report Passed Failed Skipped Time
ecs-logging-core/target/surefire-reports/TEST-co.elastic.logging.EcsJsonSerializerTest.xml 9✔️ 259ms
ecs-logging-core/target/surefire-reports/TEST-co.elastic.logging.TimestampSerializerTest.xml 2✔️ 554ms
jboss-logmanager-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jboss.logmanager.EcsFormatterTest.xml 3✔️ 13ms
jboss-logmanager-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jboss.logmanager.JBossLogManagerTest.xml 10✔️ 306ms
jul-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jul.EcsFormatterTest.xml 7✔️ 14ms
jul-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jul.JulIntegrationTest.xml 11✔️ 300ms
jul-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jul.JulLoggingTest.xml 11✔️ 50ms
log4j-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j.Log4jEcsLayoutIntegrationTest.xml 10✔️ 54ms
log4j-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j.Log4jEcsLayoutTest.xml 10✔️ 456ms
log4j-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.log4j.LegacyLog4jEcsLayoutTest.xml 10✔️ 322ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.CurrentLog4j2EcsLayoutTest.xml 20✔️ 123ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithCustomMdcSerializerTest.xml 16✔️ 119ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithExceptionPatternTest.xml 17✔️ 689ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithNotExistCustomMdcSerializerTest.xml 1✔️ 1ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithStackTraceAsArrayTest.xml 17✔️ 121ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.Log4j2EcsBuilderTest.xml 1✔️ 0ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.Log4j2EcsLayoutIntegrationTest.xml 17✔️ 97ms
log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.MdcSerializerResolverTest.xml 4✔️ 1ms
log4j2-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.log4j2.LegacyLog4j2EcsLayoutTest.xml 17✔️ 517ms
logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderIntegrationTest.xml 11✔️ 421ms
logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderTest.xml 11✔️ 42ms
logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderWithCustomThrowableConverterIntegrationTest.xml 11✔️ 63ms
logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderWithStacktraceAsArrayTest.xml 11✔️ 7ms
logback-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.logback.LegacyEcsEncoderIntegrationTest.xml 11✔️ 163ms
logback-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.logback.LegacyEcsEncoderTest.xml 11✔️ 328ms

✔️ ecs-logging-core/target/surefire-reports/TEST-co.elastic.logging.EcsJsonSerializerTest.xml

9 tests were completed in 259ms with 9 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.EcsJsonSerializerTest 9✔️ 259ms

✔️ co.elastic.logging.EcsJsonSerializerTest

✔️ testEscaping
✔️ serializeNullDoesNotThrowAnException
✔️ serializeExceptionWithStackTraceAsArray
✔️ testRemoveIfEndsWith
✔️ serializeExceptionWithNullMessage
✔️ serializeExceptionAsArray
✔️ serializeException
✔️ serializeExceptionAsString
✔️ serializeExceptionWithSingleLineStackTraceAsArray

✔️ ecs-logging-core/target/surefire-reports/TEST-co.elastic.logging.TimestampSerializerTest.xml

2 tests were completed in 554ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.TimestampSerializerTest 2✔️ 554ms

✔️ co.elastic.logging.TimestampSerializerTest

✔️ testSerializeWithCustomLocale
✔️ testSerializeEpochTimestampAsIsoDateTime

✔️ jboss-logmanager-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jboss.logmanager.EcsFormatterTest.xml

3 tests were completed in 13ms with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.jboss.logmanager.EcsFormatterTest 3✔️ 13ms

✔️ co.elastic.logging.jboss.logmanager.EcsFormatterTest

✔️ testMultipleNDCInformationLogging
✔️ testExceptionLogging
✔️ testSingleNDCInformationLogging

✔️ jboss-logmanager-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jboss.logmanager.JBossLogManagerTest.xml

10 tests were completed in 306ms with 10 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.jboss.logmanager.JBossLogManagerTest 10✔️ 306ms

✔️ co.elastic.logging.jboss.logmanager.JBossLogManagerTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog

✔️ jul-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jul.EcsFormatterTest.xml

7 tests were completed in 14ms with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.jul.EcsFormatterTest 7✔️ 14ms

✔️ co.elastic.logging.jul.EcsFormatterTest

✔️ testFormatWithoutLoggerName
✔️ testFormatWithInnerClassName
✔️ testFormatWithInvalidClassName
✔️ testFormatWithEmptyLoggerName
✔️ testFormatWithoutIncludeOriginFlag
✔️ testMdcSerialization_singleEntry
✔️ testFormatWithIncludeOriginFlag

✔️ jul-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jul.JulIntegrationTest.xml

11 tests were completed in 300ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.jul.JulIntegrationTest 11✔️ 300ms

✔️ co.elastic.logging.jul.JulIntegrationTest

✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testLogOrigin
✔️ testAdditionalFieldsAsList
✔️ testLogExceptionNullMessage
✔️ testLogException

✔️ jul-ecs-formatter/target/surefire-reports/TEST-co.elastic.logging.jul.JulLoggingTest.xml

11 tests were completed in 50ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.jul.JulLoggingTest 11✔️ 50ms

✔️ co.elastic.logging.jul.JulLoggingTest

✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testLogOrigin
✔️ testAdditionalFieldsAsList

✔️ log4j-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j.Log4jEcsLayoutIntegrationTest.xml

10 tests were completed in 54ms with 10 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j.Log4jEcsLayoutIntegrationTest 10✔️ 54ms

✔️ co.elastic.logging.log4j.Log4jEcsLayoutIntegrationTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog

✔️ log4j-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j.Log4jEcsLayoutTest.xml

10 tests were completed in 456ms with 10 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j.Log4jEcsLayoutTest 10✔️ 456ms

✔️ co.elastic.logging.log4j.Log4jEcsLayoutTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog

✔️ log4j-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.log4j.LegacyLog4jEcsLayoutTest.xml

10 tests were completed in 322ms with 10 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j.LegacyLog4jEcsLayoutTest 10✔️ 322ms

✔️ co.elastic.logging.log4j.LegacyLog4jEcsLayoutTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.CurrentLog4j2EcsLayoutTest.xml

20 tests were completed in 123ms with 20 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.CurrentLog4j2EcsLayoutTest 20✔️ 123ms

✔️ co.elastic.logging.log4j2.CurrentLog4j2EcsLayoutTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testJsonMessageBoolean
✔️ testJsonMessageArray
✔️ testJsonMessageNumber
✔️ testJsonMessageString
✔️ testCustomPatternConverter
✔️ testAdditionalFieldsWithLookup
✔️ testMarker
✔️ testJsonMessageObject
✔️ testMapMessage
✔️ testParameterizedStructuredMessage

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithCustomMdcSerializerTest.xml

16 tests were completed in 119ms with 16 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.EcsLayoutWithCustomMdcSerializerTest 16✔️ 119ms

✔️ co.elastic.logging.log4j2.EcsLayoutWithCustomMdcSerializerTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testJsonMessageBoolean
✔️ testJsonMessageArray
✔️ testJsonMessageNumber
✔️ testJsonMessageString
✔️ testCustomPatternConverter
✔️ testMarker

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithExceptionPatternTest.xml

17 tests were completed in 689ms with 17 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.EcsLayoutWithExceptionPatternTest 17✔️ 689ms

✔️ co.elastic.logging.log4j2.EcsLayoutWithExceptionPatternTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testJsonMessageBoolean
✔️ testJsonMessageArray
✔️ testJsonMessageNumber
✔️ testJsonMessageString
✔️ testCustomPatternConverter
✔️ testAdditionalFieldsWithLookup
✔️ testMarker
✔️ testLogExceptionNullMessage
✔️ testLogException

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithNotExistCustomMdcSerializerTest.xml

1 tests were completed in 1ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.EcsLayoutWithNotExistCustomMdcSerializerTest 1✔️ 1ms

✔️ co.elastic.logging.log4j2.EcsLayoutWithNotExistCustomMdcSerializerTest

✔️ testThrowExceptionIfMdcSerializerNotExist

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.EcsLayoutWithStackTraceAsArrayTest.xml

17 tests were completed in 121ms with 17 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.EcsLayoutWithStackTraceAsArrayTest 17✔️ 121ms

✔️ co.elastic.logging.log4j2.EcsLayoutWithStackTraceAsArrayTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testJsonMessageBoolean
✔️ testJsonMessageArray
✔️ testJsonMessageNumber
✔️ testJsonMessageString
✔️ testCustomPatternConverter
✔️ testAdditionalFieldsWithLookup
✔️ testMarker
✔️ testLogExceptionNullMessage
✔️ testLogException

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.Log4j2EcsBuilderTest.xml

1 tests were completed in 0ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.Log4j2EcsBuilderTest 1✔️ 0ms

✔️ co.elastic.logging.log4j2.Log4j2EcsBuilderTest

✔️ testAdditionalFieldsCanBeEmptyInBuilder

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.Log4j2EcsLayoutIntegrationTest.xml

17 tests were completed in 97ms with 17 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.Log4j2EcsLayoutIntegrationTest 17✔️ 97ms

✔️ co.elastic.logging.log4j2.Log4j2EcsLayoutIntegrationTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testJsonMessageBoolean
✔️ testJsonMessageArray
✔️ testJsonMessageNumber
✔️ testJsonMessageString
✔️ testCustomPatternConverter
✔️ testAdditionalFieldsWithLookup
✔️ testMarker

✔️ log4j2-ecs-layout/target/surefire-reports/TEST-co.elastic.logging.log4j2.MdcSerializerResolverTest.xml

4 tests were completed in 1ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.MdcSerializerResolverTest 4✔️ 1ms

✔️ co.elastic.logging.log4j2.MdcSerializerResolverTest

✔️ testResolveWithInvalidClassName
✔️ testResolveWithValidClassName
✔️ testResolveWithEmptyString
✔️ testResolveWithNull

✔️ log4j2-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.log4j2.LegacyLog4j2EcsLayoutTest.xml

17 tests were completed in 517ms with 17 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.log4j2.LegacyLog4j2EcsLayoutTest 17✔️ 517ms

✔️ co.elastic.logging.log4j2.LegacyLog4j2EcsLayoutTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testJsonMessageBoolean
✔️ testJsonMessageArray
✔️ testJsonMessageNumber
✔️ testJsonMessageString
✔️ testCustomPatternConverter
✔️ testAdditionalFieldsWithLookup
✔️ testMarker

✔️ logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderIntegrationTest.xml

11 tests were completed in 421ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.logback.EcsEncoderIntegrationTest 11✔️ 421ms

✔️ co.elastic.logging.logback.EcsEncoderIntegrationTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testMarker

✔️ logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderTest.xml

11 tests were completed in 42ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.logback.EcsEncoderTest 11✔️ 42ms

✔️ co.elastic.logging.logback.EcsEncoderTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testMarker

✔️ logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderWithCustomThrowableConverterIntegrationTest.xml

11 tests were completed in 63ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.logback.EcsEncoderWithCustomThrowableConverterIntegrationTest 11✔️ 63ms

✔️ co.elastic.logging.logback.EcsEncoderWithCustomThrowableConverterIntegrationTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testMarker
✔️ testLogException

✔️ logback-ecs-encoder/target/surefire-reports/TEST-co.elastic.logging.logback.EcsEncoderWithStacktraceAsArrayTest.xml

11 tests were completed in 7ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.logback.EcsEncoderWithStacktraceAsArrayTest 11✔️ 7ms

✔️ co.elastic.logging.logback.EcsEncoderWithStacktraceAsArrayTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testMarker
✔️ testLogExceptionNullMessage
✔️ testLogException

✔️ logback-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.logback.LegacyEcsEncoderIntegrationTest.xml

11 tests were completed in 163ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.logback.LegacyEcsEncoderIntegrationTest 11✔️ 163ms

✔️ co.elastic.logging.logback.LegacyEcsEncoderIntegrationTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testMarker

✔️ logback-legacy-tests/target/surefire-reports/TEST-co.elastic.logging.logback.LegacyEcsEncoderTest.xml

11 tests were completed in 328ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
co.elastic.logging.logback.LegacyEcsEncoderTest 11✔️ 328ms

✔️ co.elastic.logging.logback.LegacyEcsEncoderTest

✔️ testLogOrigin
✔️ testSimpleLog
✔️ testMdc
✔️ testThreadContext
✔️ testAdditionalFields
✔️ testMetadata
✔️ testLogExceptionNullMessage
✔️ testLogException
✔️ testThreadContextStack
✔️ testSimpleParameterizedLog
✔️ testMarker