Skip to content

Add support for Log4j2's MultiFormatStringBuilderFormattable in structured logging #42034

@mhalbritter

Description

@mhalbritter

At the moment, this code

LOG4J.info(new MapMessage<>().with("foo", true).with("bar", 1.0));

leads to this output:

{"@timestamp":"2024-08-27T14:05:28.609449Z","log.level":"INFO","process.pid":13608,"process.thread.name":"main","service.name":"structured-logging-playground","log.logger":"com.example.structuredloggingplayground.CLR","message":"bar=\"1.0\" foo=\"true\"","ecs.version":"8.11"}

Instead, it should add "foo" and "bar" as separate keys and also preserve the datatypes.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions