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