Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-23 Thread Jean-Baptiste Onofré
Hi, It's planned for this week. I'm merging the PR and I will open other PRs. Stay tuned ! ;) Regards JB On 23/07/2019 17:35, Noobtube Account wrote: > Hi JB, > > Will you also be releasing decanter? We are interested in getting this fix:  > https://github.com/apache/karaf-decanter/pull/93 >

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-23 Thread Noobtube Account
Hi JB, Will you also be releasing decanter? We are interested in getting this fix: https://github.com/apache/karaf-decanter/pull/93 Cheers! On Tue, 23 Jul 2019 at 7:09 pm, Jean-Baptiste Onofré wrote: > Hi, > > FYI, there is an issue in pax-logging-log4j2-extra in 1.10.2. > > I'm fixing and

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-23 Thread Jean-Baptiste Onofré
Hi, FYI, there is an issue in pax-logging-log4j2-extra in 1.10.2. I'm fixing and cutting a new release. A Karaf release will happen very soon. Regards JB On 08/06/2019 16:17, Noobtube Account wrote: > I'm trying to get JSON format logging enabled in Karaf. Trying to do > something similar to

RE: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-17 Thread Jean-Baptiste Onofré
Hi I already have a fix in pax-logging. I will merge and cut a release. Regards JB Le 17 juil. 2019 à 10:56, à 10:56, VIEILLARD Francois a écrit: >Hello > >Isn't this linked to https://issues.apache.org/jira/browse/KARAF-6345 ? > >I have the same problem when trying to log using Log4j2

RE: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-17 Thread VIEILLARD Francois
Hello Isn't this linked to https://issues.apache.org/jira/browse/KARAF-6345 ? I have the same problem when trying to log using Log4j2 JsonLayout It seems that 'pax-logging-log4j2-extra' correctly tries to import jackson packages (optional-import) but it doesn't get resolved, even when

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-02 Thread Jean-Baptiste Onofré
Catcha, let me double check the imports then. I will probably cut Pax Logging 1.10.3 with the fix and so a Karaf release will follow to fix that. I keep you posted. Regards JB On 01/07/2019 16:00, lechlukasz wrote: > I've installed mvn:org.ops4j.pax.logging/pax-logging-log4j2-extra/1.10.2 >

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-01 Thread lechlukasz
I've installed mvn:org.ops4j.pax.logging/pax-logging-log4j2-extra/1.10.2 (through console bundle:install) and it do import com.fasterxml.jackson.databind.ser, but I still get the same error from mvn:org.ops4j.pax.logging/pax-logging-log4j2/1.10.2 Decanter looks like an overkill, especially that

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-01 Thread Jean-Baptiste Onofré
If you have using 4.2.6, don't forget to install pax-logging-log4j2-extra bundle. Let me double check the imports anyway. Regards JB On 01/07/2019 14:11, lechlukasz wrote: > Hello, > > I've just got similar problem after trying to activate JSON logging for > Karaf 4.2.6, with configuration

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-07-01 Thread lechlukasz
Hello, I've just got similar problem after trying to activate JSON logging for Karaf 4.2.6, with configuration that worked perfectly in 4.1.2: log4j2.appender.rolling.layout.type = JsonLayout log4j2.appender.rolling.layout.compact = true log4j2.appender.rolling.layout.eventEol = true I'm

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-23 Thread Jean-Baptiste Onofré
Yes, you can filter at collecting time or appending time. Up to you. Regards JB On 24/06/2019 04:04, Noobtube Account wrote: > Looks like what I’m looking for can be done using collector not appender.  > > org.apache.karaf.decanter.collector.log.cfg:  > fields.remove.renderedMessage=true > >

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-23 Thread Noobtube Account
Looks like what I’m looking for can be done using collector not appender. org.apache.karaf.decanter.collector.log.cfg: fields.remove.renderedMessage=true Cheers! On Mon, 24 Jun 2019 at 11:54 am, Noobtube Account wrote: > Thanks JB - I think the EventFilter and the properties along with it are

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-23 Thread Noobtube Account
Thanks JB - I think the EventFilter and the properties along with it are used to include/exclude entire events, correct? In that case, I’m not able to use it to exclude fields of the resulting json log but instead exclude entire logs based on the content of the log message. I guess I’ll need to

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-21 Thread Jean-Baptiste Onofré
Hi, I guess you are talking about filtering of the events to send to the appender right ? I will update the Decanter documentation with some example and how it works. In the mean time, you can take a look on the test illustrating the events filtering:

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-21 Thread Noobtube Account
Hi JB, Could you show me where I could add the filter properties as you mentioned or if it’s not implemented yet, some guidance on accessing the appender or Marshaller properties file from inside the default decanter json appender? Thanks On Wed, 12 Jun 2019 at 11:53 am, Noobtube Account

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-11 Thread Noobtube Account
Thanks JB! I've got the following config for appender to try out the field exclude: # File filename=${karaf.data}/log/karaf-json.log # Marshaller marshaller.target=(dataFormat=json) # Append file append=true # Fields Excluded by Name event.property.name.exclude=MDC This seems to stop the

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Jean-Baptiste Onofré
Yes, you can create your own marshaller is you want to ;) By default, Decanter collectors send a Map to the Decanter appenders. Then the appenders use eventually marshaller to convert the Map to something else. You can control the keys or values in this map that you want to include/exclude by

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Noobtube Account
Great! Are we also able to control the format or turn fields off? On Sun, 9 Jun 2019 at 2:51 am, Jean-Baptiste Onofré wrote: > Yes, Decanter Log Collector is a global Pax Logging "sniffer". So it > takes messages from any bundle by default. > > However, you can configure this directly in

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Jean-Baptiste Onofré
Yes, Decanter Log Collector is a global Pax Logging "sniffer". So it takes messages from any bundle by default. However, you can configure this directly in etc/org.ops4j.pax.logging.cfg. Regards JB On 08/06/2019 18:07, Noobtube Account wrote: > Oh, scratch that. Uncommenting the filename in >

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Noobtube Account
Oh, scratch that. Uncommenting the filename in etc/org.apache.karaf.decanter.appender.file.cfg seemed to have made it work. It probably wasn't due to that though and likely something else I did. Anyway, thanks for pointing out karaf decanter. Will the log collector collect log executions made

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Noobtube Account
Thanks JB. I'm trying the decanter as you mentioned. I've done: feature:repo-add decanter feature:install decanter-collector-log feature:install decanter-appender-file Then I edited etc/org.apache.karaf.decanter.appender.file.cfg and added: # Marshaller marshaller.target=(dataFormat=json) But I

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Jean-Baptiste Onofré
By the way, instead of doing that, you can use regular logging and use Decanter with the log collector and the json marshaller to create json output (to log, file, elasticsearch or whatever). Regards JB On 08/06/2019 16:30, Jean-Baptiste Onofré wrote: > Hi > > You don't have to add logback-core

Re: Adding Jackson to Karaf startup.properties file to enable JSON logging

2019-06-08 Thread Jean-Baptiste Onofré
Hi You don't have to add logback-core as pax-logging-logback bundle already embed it. Secondly it seems jackson is not imported correctly. The root cause is: Caused by: java.lang.ClassNotFoundException: > com.fasterxml.jackson.databind.ObjectMapper not found by >