Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-08-05 Thread Dominik Sandjaja
Argh, good point: https://issues.apache.org/jira/browse/LOG4J2-2670 On 30.07.19, 20:30, "Ralph Goers" wrote: Did you create a Jira issue for this? One of us might get around to it but we never will without the Jira issue reminding us.

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-30 Thread Ralph Goers
Did you create a Jira issue for this? One of us might get around to it but we never will without the Jira issue reminding us. Ralph > On Jul 16, 2019, at 8:12 AM, Dominik Sandjaja > wrote: > > Hello everybody, > > thank you all for the discussion about this topic. > > My initial thought was

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-16 Thread Dominik Sandjaja
Hello everybody, thank you all for the discussion about this topic. My initial thought was that I was maybe missing some configuration option for setting the classname of one of the initialization classes to override the object creation. But after looking a bit into the Log4J Plugin system I ag

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-13 Thread Matt Sicker
Oh, that's a part of the plugin system I often forget about since most plugins are core plugins. In any case, a plugin of some sort would be the most flexible here I think. On Sat, 13 Jul 2019 at 15:21, Ralph Goers wrote: > > Just because it is a plugin doesn’t mean it can be used anywhere. The

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-13 Thread Ralph Goers
Just because it is a plugin doesn’t mean it can be used anywhere. The JacksonFactory could collect plugins for its own category, which would mean they couldn’t be specified in the configuration. Only “core” plugins can directly be used as parameters in the configuration. But yes, once it is a co

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-13 Thread Matt Sicker
Being a plugin means you can inject it as a @PluginElement wherever. Plus, that makes it easier for users to write a custom plugin class to configure any other options they want. Comparable to the DataSourceFactory or whatever it’s called for JDBC drivers in that plugin. Keeping it as an element s

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Ralph Goers
Actually, I was thinking that we can keep the existing ObjectMapper but supply a Function that can “enhance” the ObjectMapper either at the end of the Log4jJsonObjectMapper constructor, at the end of JacksonFactory.newObjectMapper, or after the ObjectMapper is constructed in JacksonFactory.newW

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Carter Kozak
I like the idea of an ObjectMapperFactory plugin point. That gives us a cleaner builder API on JsonLayout where we can potentially pass in a supplier for an ObjectMapper instance from programmatic configuration. On Fri, Jul 12, 2019, at 19:10, Matt Sicker wrote: > And by plugin, see for example

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Matt Sicker
And by plugin, see for example the various BlockingQueueFactory plugins. On Fri, Jul 12, 2019 at 18:09, Matt Sicker wrote: > Plugin maybe? I think we could potentially extend the plugin system as a > general dependency and configuration injection system. We can make less > special case methods o

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Matt Sicker
Plugin maybe? I think we could potentially extend the plugin system as a general dependency and configuration injection system. We can make less special case methods of pseudo components and options outside that. On Fri, Jul 12, 2019 at 17:34, Gary Gregory wrote: > Hi Dominik > > I see two ways

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Gary Gregory
Hi Dominik I see two ways of addressing this: 1) Add a setObjectMapper(ObjectMapper) to org.apache.logging.log4j.core.layout.JsonLayout.Builder This would work well for programmatic configurations and/or: 2) Add a setObjectMapperFactory(String) to org.apache.logging.log4j.core.layout.JsonLayout.

Re: How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Volkan Yazıcı
Hello Dominik, I don't know how you can achieve that using JsonLayout. That said, it sounds like a really valid use case and I have already created a log4j2-logstash-layout ticket for it . I plan to implement it in a couple of weeks and cut a

How to configure ObjectMapper of Log4j2 JSON Layout

2019-07-12 Thread Dominik Sandjaja
Hello, we are using the JSON layout in our Spring Boot application to easily ingest the logs in Elasticsearch. One message that we log is about failed conversions, when an incoming request parameter cannot be converted correctly. As we use Spring’s Converter functionality for this, these `Ille