You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by Catherine Johnson <ca...@yahoo.com> on 2015/09/05 02:01:12 UTC
Geode Logging as JSON
Has anyone ever coerced Geode to output log message elements as JSON?
Thanks!
Catherine
Re: Geode Logging as JSON
Posted by Kirk Lund <kl...@pivotal.io>.
I think the Log4J2 JSONLayout will do what you want:
https://logging.apache.org/log4j/2.x/manual/layouts.html
You would need to copy the Geode log4j2-default.xml from
https://github.com/apache/incubator-geode/blob/develop/gemfire-core/src/main/resources/com/gemstone/gemfire/internal/logging/log4j/log4j2-default.xml
...and use that file as a starting point. Change the gemfire PatternLayout
to JSONLayout and experiment.
Save your custom log4j2-default.xml as log4j2.xml and either place it in
your classpath or start your locators & servers with
-Dlog4j.configurationFile=<your-config-file>.
-Kirk
On Friday, September 4, 2015, Catherine Johnson <ca...@yahoo.com>
wrote:
> More importantly, I want the content to be escaped JSON, so… if there is a
> stack trace that is thrown, it is already in the right format.
>
> On Sep 4, 2015, at 5:20 PM, Roman Shaposhnik <roman@shaposhnik.org
> <javascript:;>> wrote:
>
> > On Fri, Sep 4, 2015 at 5:06 PM, Catherine Johnson
> > <catherinej30@yahoo.com <javascript:;>> wrote:
> >> I don’t really care - I just want the elements (time, message, thread
> name, exception)
> >
> > Ah! But you do ;-) The above (time, message, thread name, exception)
> > is exactly the
> > schema I had in mind. Take a look at
> https://github.com/michaeltandy/log4j-json
> > (or other projects like this). It may be able to do what you want.
> >
> >> to be escaped JSON so I can ingest them elsewhere. I am doing this
> manually now,
> >> but would prefer for Geode to output escaped JSON natively. The sheer
> number of
> >> messages coming out of the system means that I would have to do LOTS of
> transformation
> >> someplace else, but if they were already JSON, it makes processing
> easier.
> >
> > Back at Cloudera we had to create morphlines in order to deal with
> exactly that:
> >
> http://cloudera.github.io/cdk/docs/0.9.1/cdk-morphlines/morphlinesReferenceGuide.html#/readMultiLine
> >
> > Thanks,
> > Roman.
>
>
Re: Geode Logging as JSON
Posted by Catherine Johnson <ca...@yahoo.com>.
More importantly, I want the content to be escaped JSON, so… if there is a stack trace that is thrown, it is already in the right format.
On Sep 4, 2015, at 5:20 PM, Roman Shaposhnik <ro...@shaposhnik.org> wrote:
> On Fri, Sep 4, 2015 at 5:06 PM, Catherine Johnson
> <ca...@yahoo.com> wrote:
>> I don’t really care - I just want the elements (time, message, thread name, exception)
>
> Ah! But you do ;-) The above (time, message, thread name, exception)
> is exactly the
> schema I had in mind. Take a look at https://github.com/michaeltandy/log4j-json
> (or other projects like this). It may be able to do what you want.
>
>> to be escaped JSON so I can ingest them elsewhere. I am doing this manually now,
>> but would prefer for Geode to output escaped JSON natively. The sheer number of
>> messages coming out of the system means that I would have to do LOTS of transformation
>> someplace else, but if they were already JSON, it makes processing easier.
>
> Back at Cloudera we had to create morphlines in order to deal with exactly that:
> http://cloudera.github.io/cdk/docs/0.9.1/cdk-morphlines/morphlinesReferenceGuide.html#/readMultiLine
>
> Thanks,
> Roman.
Re: Geode Logging as JSON
Posted by Roman Shaposhnik <ro...@shaposhnik.org>.
On Fri, Sep 4, 2015 at 5:06 PM, Catherine Johnson
<ca...@yahoo.com> wrote:
> I don’t really care - I just want the elements (time, message, thread name, exception)
Ah! But you do ;-) The above (time, message, thread name, exception)
is exactly the
schema I had in mind. Take a look at https://github.com/michaeltandy/log4j-json
(or other projects like this). It may be able to do what you want.
> to be escaped JSON so I can ingest them elsewhere. I am doing this manually now,
> but would prefer for Geode to output escaped JSON natively. The sheer number of
> messages coming out of the system means that I would have to do LOTS of transformation
> someplace else, but if they were already JSON, it makes processing easier.
Back at Cloudera we had to create morphlines in order to deal with exactly that:
http://cloudera.github.io/cdk/docs/0.9.1/cdk-morphlines/morphlinesReferenceGuide.html#/readMultiLine
Thanks,
Roman.
Re: Geode Logging as JSON
Posted by Catherine Johnson <ca...@yahoo.com>.
I don’t really care - I just want the elements (time, message, thread name, exception) to be escaped JSON so I can ingest them elsewhere. I am doing this manually now, but would prefer for Geode to output escaped JSON natively. The sheer number of messages coming out of the system means that I would have to do LOTS of transformation someplace else, but if they were already JSON, it makes processing easier.
Thanks!
Catherine
> On Sep 4, 2015, at 5:02 PM, Roman Shaposhnik <ro...@shaposhnik.org> wrote:
>
> What JSON "schema" do you have in mind for such output?
>
> Thanks,
> Roman.
>
> On Fri, Sep 4, 2015 at 5:01 PM, Catherine Johnson
> <ca...@yahoo.com> wrote:
>> Has anyone ever coerced Geode to output log message elements as JSON?
>>
>> Thanks!
>> Catherine
Re: Geode Logging as JSON
Posted by Roman Shaposhnik <ro...@shaposhnik.org>.
What JSON "schema" do you have in mind for such output?
Thanks,
Roman.
On Fri, Sep 4, 2015 at 5:01 PM, Catherine Johnson
<ca...@yahoo.com> wrote:
> Has anyone ever coerced Geode to output log message elements as JSON?
>
> Thanks!
> Catherine