I don't think you can do anything right now. I implemented a feature for
ObjectMessage but not for MapMessage last month.

https://github.com/apache/logging-log4j2/pull/141

On Wed, Feb 14, 2018 at 12:47 AM, Atle Tokle <ato...@gmail.com> wrote:

> I add key/values to logging using MapMessage like this.
> logger.info(new MapMessage().with("key1", "value1").with("key2",
> "value2"));
>
> I see that the MapMessage can format messages as key="value", json and XML.
>
> I use a JsonAppender to ouput a format that is easy indexable by our
> log-management system.
> But the MapMessage is not output as json. I get this:
> "message" : "key1=\"value1\" key2=\"value2\"",
>
> But I would expect:
> "message" :
>    {"key1" : "value1",
>     "key2" : "value2"
>    }
>
> Is it something I can configure to get this?
>
> Atle
>

Reply via email to