You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Volkan Yazıcı <vo...@gmail.com> on 2020/01/08 21:42:29 UTC

Re: Thoughts on XML/JSON/YAML layout in Log4j 3.0 (Was: Feature request/possible contribution)

On Tue, Dec 24, 2019 at 10:48 PM Volkan Yazıcı <vo...@gmail.com> wrote:
> In its current form, LogstashLayout can (almost) very well render the
> GELF layout[1]. There are only two shortcomings: 1) epoch seconds with
> fraction and 2) using PatternLayout while rendering messages. But no
> worries, I will address them[2,3] in a couple of days.

I have finally released log4j2-logstash-layout v1.0.0[1], which
includes GELF layout[2]. Exposing epoch seconds of type double in the
JSON template variables as efficiently as Log4j 2.0 GelfLayout turned
out to be a tougher cookie than I was anticipating. But I can't
complain, thanks to the feature, I've stepped into the Jackson hall of
fame[3,4]. For those interested in, LogstashLayout is *still* the
fastest JSON layout and I've updated the benchmark[5] accordingly.

In my next adventure, I will see if I can beat PatternLayout with a
generic template engine, e.g., Rocker[6]. If that experiment turns out
to be positive, I will extend it with JsonLayout.

[1] https://github.com/vy/log4j2-logstash-layout/blob/master/CHANGELOG.md#2020-01-08-v100
[2] https://github.com/vy/log4j2-logstash-layout#predefined-templates
[3] https://github.com/FasterXML/jackson-core/pull/589
[4] https://github.com/FasterXML/jackson-core/pull/590
[5] https://github.com/vy/log4j2-logstash-layout#performance
[6] https://github.com/fizzed/rocker

Re: Thoughts on XML/JSON/YAML layout in Log4j 3.0 (Was: Feature request/possible contribution)

Posted by Ralph Goers <ra...@dslextreme.com>.
I would integrate it as is. Once it is here you can continue the work on converting it to use templates or create an entirely new Layout. 

Ralph

> On Jan 9, 2020, at 6:28 AM, Volkan Yazıcı <vo...@gmail.com> wrote:
> 
> Yes. I had the intention that you first wanted to see if a generic
> text-based templating solution would work, since you were the one
> proposing this idea in the first place. Would you rather first see the
> current LogstashLayout replacing JsonLayout in log4j-core? If so, I
> can first focus on integrating LogstashLayout into log4j-core.
> 
> On Thu, Jan 9, 2020 at 1:19 AM Ralph Goers <ra...@dslextreme.com> wrote:
>> 
>> Are you still considering contributing this?
>> 
>> Ralph
>> 
>>> On Jan 8, 2020, at 2:42 PM, Volkan Yazıcı <vo...@gmail.com> wrote:
>>> 
>>> On Tue, Dec 24, 2019 at 10:48 PM Volkan Yazıcı <vo...@gmail.com> wrote:
>>>> In its current form, LogstashLayout can (almost) very well render the
>>>> GELF layout[1]. There are only two shortcomings: 1) epoch seconds with
>>>> fraction and 2) using PatternLayout while rendering messages. But no
>>>> worries, I will address them[2,3] in a couple of days.
>>> 
>>> I have finally released log4j2-logstash-layout v1.0.0[1], which
>>> includes GELF layout[2]. Exposing epoch seconds of type double in the
>>> JSON template variables as efficiently as Log4j 2.0 GelfLayout turned
>>> out to be a tougher cookie than I was anticipating. But I can't
>>> complain, thanks to the feature, I've stepped into the Jackson hall of
>>> fame[3,4]. For those interested in, LogstashLayout is *still* the
>>> fastest JSON layout and I've updated the benchmark[5] accordingly.
>>> 
>>> In my next adventure, I will see if I can beat PatternLayout with a
>>> generic template engine, e.g., Rocker[6]. If that experiment turns out
>>> to be positive, I will extend it with JsonLayout.
>>> 
>>> [1] https://github.com/vy/log4j2-logstash-layout/blob/master/CHANGELOG.md#2020-01-08-v100
>>> [2] https://github.com/vy/log4j2-logstash-layout#predefined-templates
>>> [3] https://github.com/FasterXML/jackson-core/pull/589
>>> [4] https://github.com/FasterXML/jackson-core/pull/590
>>> [5] https://github.com/vy/log4j2-logstash-layout#performance
>>> [6] https://github.com/fizzed/rocker
>>> 
>> 
>> 
> 



Re: Thoughts on XML/JSON/YAML layout in Log4j 3.0 (Was: Feature request/possible contribution)

Posted by Volkan Yazıcı <vo...@gmail.com>.
Yes. I had the intention that you first wanted to see if a generic
text-based templating solution would work, since you were the one
proposing this idea in the first place. Would you rather first see the
current LogstashLayout replacing JsonLayout in log4j-core? If so, I
can first focus on integrating LogstashLayout into log4j-core.

On Thu, Jan 9, 2020 at 1:19 AM Ralph Goers <ra...@dslextreme.com> wrote:
>
> Are you still considering contributing this?
>
> Ralph
>
> > On Jan 8, 2020, at 2:42 PM, Volkan Yazıcı <vo...@gmail.com> wrote:
> >
> > On Tue, Dec 24, 2019 at 10:48 PM Volkan Yazıcı <vo...@gmail.com> wrote:
> >> In its current form, LogstashLayout can (almost) very well render the
> >> GELF layout[1]. There are only two shortcomings: 1) epoch seconds with
> >> fraction and 2) using PatternLayout while rendering messages. But no
> >> worries, I will address them[2,3] in a couple of days.
> >
> > I have finally released log4j2-logstash-layout v1.0.0[1], which
> > includes GELF layout[2]. Exposing epoch seconds of type double in the
> > JSON template variables as efficiently as Log4j 2.0 GelfLayout turned
> > out to be a tougher cookie than I was anticipating. But I can't
> > complain, thanks to the feature, I've stepped into the Jackson hall of
> > fame[3,4]. For those interested in, LogstashLayout is *still* the
> > fastest JSON layout and I've updated the benchmark[5] accordingly.
> >
> > In my next adventure, I will see if I can beat PatternLayout with a
> > generic template engine, e.g., Rocker[6]. If that experiment turns out
> > to be positive, I will extend it with JsonLayout.
> >
> > [1] https://github.com/vy/log4j2-logstash-layout/blob/master/CHANGELOG.md#2020-01-08-v100
> > [2] https://github.com/vy/log4j2-logstash-layout#predefined-templates
> > [3] https://github.com/FasterXML/jackson-core/pull/589
> > [4] https://github.com/FasterXML/jackson-core/pull/590
> > [5] https://github.com/vy/log4j2-logstash-layout#performance
> > [6] https://github.com/fizzed/rocker
> >
>
>

Re: Thoughts on XML/JSON/YAML layout in Log4j 3.0 (Was: Feature request/possible contribution)

Posted by Ralph Goers <ra...@dslextreme.com>.
Are you still considering contributing this?

Ralph

> On Jan 8, 2020, at 2:42 PM, Volkan Yazıcı <vo...@gmail.com> wrote:
> 
> On Tue, Dec 24, 2019 at 10:48 PM Volkan Yazıcı <vo...@gmail.com> wrote:
>> In its current form, LogstashLayout can (almost) very well render the
>> GELF layout[1]. There are only two shortcomings: 1) epoch seconds with
>> fraction and 2) using PatternLayout while rendering messages. But no
>> worries, I will address them[2,3] in a couple of days.
> 
> I have finally released log4j2-logstash-layout v1.0.0[1], which
> includes GELF layout[2]. Exposing epoch seconds of type double in the
> JSON template variables as efficiently as Log4j 2.0 GelfLayout turned
> out to be a tougher cookie than I was anticipating. But I can't
> complain, thanks to the feature, I've stepped into the Jackson hall of
> fame[3,4]. For those interested in, LogstashLayout is *still* the
> fastest JSON layout and I've updated the benchmark[5] accordingly.
> 
> In my next adventure, I will see if I can beat PatternLayout with a
> generic template engine, e.g., Rocker[6]. If that experiment turns out
> to be positive, I will extend it with JsonLayout.
> 
> [1] https://github.com/vy/log4j2-logstash-layout/blob/master/CHANGELOG.md#2020-01-08-v100
> [2] https://github.com/vy/log4j2-logstash-layout#predefined-templates
> [3] https://github.com/FasterXML/jackson-core/pull/589
> [4] https://github.com/FasterXML/jackson-core/pull/590
> [5] https://github.com/vy/log4j2-logstash-layout#performance
> [6] https://github.com/fizzed/rocker
>