You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Mikael Ståldal <mi...@magine.com> on 2017/04/28 08:14:01 UTC

YamlLayout.toSerializable

YamlLayout has this method:

@Override
public void toSerializable(final LogEvent event, final Writer writer)
throws IOException {
    if (complete && eventCount > 0) {
        writer.append(", ");
    }
    super.toSerializable(event, writer);
}

As far as I can see, it shouldn't be there since you don't separate entries
with comma in YAML. There is a similar method in JsonLayout, where it does
make sense. I guess this is a copy-and-paste mistake when making YamlLayout
with JsonLayout as template?

(XmlLayout does not have any similar method.)


-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: YamlLayout.toSerializable

Posted by Mikael Ståldal <mi...@magine.com>.
Yes, I will remove it.

On Fri, Apr 28, 2017 at 4:19 PM, Matt Sicker <bo...@gmail.com> wrote:

> Then that toSerializable() override is most likely a copy/paste error from
> JsonLayout.
>
> On 28 April 2017 at 09:15, Mikael Ståldal <mi...@magine.com>
> wrote:
>
> > YamlLayout always prefix each event with a line with "---". JsonLayout
> is a
> > bit different since you don't want a comma before the first event.
> >
> > On Fri, Apr 28, 2017 at 4:02 PM, Matt Sicker <bo...@gmail.com> wrote:
> >
> > > The YamlLayout should probably separate events by "--" or whatever the
> > page
> > > separator token is in yaml (not a widely used feature).
> > >
> > > On 28 April 2017 at 03:14, Mikael Ståldal <mi...@magine.com>
> > > wrote:
> > >
> > > > YamlLayout has this method:
> > > >
> > > > @Override
> > > > public void toSerializable(final LogEvent event, final Writer writer)
> > > > throws IOException {
> > > >     if (complete && eventCount > 0) {
> > > >         writer.append(", ");
> > > >     }
> > > >     super.toSerializable(event, writer);
> > > > }
> > > >
> > > > As far as I can see, it shouldn't be there since you don't separate
> > > entries
> > > > with comma in YAML. There is a similar method in JsonLayout, where it
> > > does
> > > > make sense. I guess this is a copy-and-paste mistake when making
> > > YamlLayout
> > > > with JsonLayout as template?
> > > >
> > > > (XmlLayout does not have any similar method.)
> > > >
> > > >
> > > > --
> > > > [image: MagineTV]
> > > >
> > > > *Mikael Ståldal*
> > > > Senior software developer
> > > >
> > > > *Magine TV*
> > > > mikael.staldal@magine.com
> > > > Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
> > > >
> > > > Privileged and/or Confidential Information may be contained in this
> > > > message. If you are not the addressee indicated in this message
> > > > (or responsible for delivery of the message to such a person), you
> may
> > > not
> > > > copy or deliver this message to anyone. In such case,
> > > > you should destroy this message and kindly notify the sender by reply
> > > > email.
> > > >
> > >
> > >
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> > >
> >
> >
> >
> > --
> > [image: MagineTV]
> >
> > *Mikael Ståldal*
> > Senior software developer
> >
> > *Magine TV*
> > mikael.staldal@magine.com
> > Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
> >
> > Privileged and/or Confidential Information may be contained in this
> > message. If you are not the addressee indicated in this message
> > (or responsible for delivery of the message to such a person), you may
> not
> > copy or deliver this message to anyone. In such case,
> > you should destroy this message and kindly notify the sender by reply
> > email.
> >
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: YamlLayout.toSerializable

Posted by Matt Sicker <bo...@gmail.com>.
Then that toSerializable() override is most likely a copy/paste error from
JsonLayout.

On 28 April 2017 at 09:15, Mikael Ståldal <mi...@magine.com> wrote:

> YamlLayout always prefix each event with a line with "---". JsonLayout is a
> bit different since you don't want a comma before the first event.
>
> On Fri, Apr 28, 2017 at 4:02 PM, Matt Sicker <bo...@gmail.com> wrote:
>
> > The YamlLayout should probably separate events by "--" or whatever the
> page
> > separator token is in yaml (not a widely used feature).
> >
> > On 28 April 2017 at 03:14, Mikael Ståldal <mi...@magine.com>
> > wrote:
> >
> > > YamlLayout has this method:
> > >
> > > @Override
> > > public void toSerializable(final LogEvent event, final Writer writer)
> > > throws IOException {
> > >     if (complete && eventCount > 0) {
> > >         writer.append(", ");
> > >     }
> > >     super.toSerializable(event, writer);
> > > }
> > >
> > > As far as I can see, it shouldn't be there since you don't separate
> > entries
> > > with comma in YAML. There is a similar method in JsonLayout, where it
> > does
> > > make sense. I guess this is a copy-and-paste mistake when making
> > YamlLayout
> > > with JsonLayout as template?
> > >
> > > (XmlLayout does not have any similar method.)
> > >
> > >
> > > --
> > > [image: MagineTV]
> > >
> > > *Mikael Ståldal*
> > > Senior software developer
> > >
> > > *Magine TV*
> > > mikael.staldal@magine.com
> > > Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
> > >
> > > Privileged and/or Confidential Information may be contained in this
> > > message. If you are not the addressee indicated in this message
> > > (or responsible for delivery of the message to such a person), you may
> > not
> > > copy or deliver this message to anyone. In such case,
> > > you should destroy this message and kindly notify the sender by reply
> > > email.
> > >
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>
>
>
> --
> [image: MagineTV]
>
> *Mikael Ståldal*
> Senior software developer
>
> *Magine TV*
> mikael.staldal@magine.com
> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>
> Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>



-- 
Matt Sicker <bo...@gmail.com>

Re: YamlLayout.toSerializable

Posted by Mikael Ståldal <mi...@magine.com>.
YamlLayout always prefix each event with a line with "---". JsonLayout is a
bit different since you don't want a comma before the first event.

On Fri, Apr 28, 2017 at 4:02 PM, Matt Sicker <bo...@gmail.com> wrote:

> The YamlLayout should probably separate events by "--" or whatever the page
> separator token is in yaml (not a widely used feature).
>
> On 28 April 2017 at 03:14, Mikael Ståldal <mi...@magine.com>
> wrote:
>
> > YamlLayout has this method:
> >
> > @Override
> > public void toSerializable(final LogEvent event, final Writer writer)
> > throws IOException {
> >     if (complete && eventCount > 0) {
> >         writer.append(", ");
> >     }
> >     super.toSerializable(event, writer);
> > }
> >
> > As far as I can see, it shouldn't be there since you don't separate
> entries
> > with comma in YAML. There is a similar method in JsonLayout, where it
> does
> > make sense. I guess this is a copy-and-paste mistake when making
> YamlLayout
> > with JsonLayout as template?
> >
> > (XmlLayout does not have any similar method.)
> >
> >
> > --
> > [image: MagineTV]
> >
> > *Mikael Ståldal*
> > Senior software developer
> >
> > *Magine TV*
> > mikael.staldal@magine.com
> > Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
> >
> > Privileged and/or Confidential Information may be contained in this
> > message. If you are not the addressee indicated in this message
> > (or responsible for delivery of the message to such a person), you may
> not
> > copy or deliver this message to anyone. In such case,
> > you should destroy this message and kindly notify the sender by reply
> > email.
> >
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: YamlLayout.toSerializable

Posted by Matt Sicker <bo...@gmail.com>.
The YamlLayout should probably separate events by "--" or whatever the page
separator token is in yaml (not a widely used feature).

On 28 April 2017 at 03:14, Mikael Ståldal <mi...@magine.com> wrote:

> YamlLayout has this method:
>
> @Override
> public void toSerializable(final LogEvent event, final Writer writer)
> throws IOException {
>     if (complete && eventCount > 0) {
>         writer.append(", ");
>     }
>     super.toSerializable(event, writer);
> }
>
> As far as I can see, it shouldn't be there since you don't separate entries
> with comma in YAML. There is a similar method in JsonLayout, where it does
> make sense. I guess this is a copy-and-paste mistake when making YamlLayout
> with JsonLayout as template?
>
> (XmlLayout does not have any similar method.)
>
>
> --
> [image: MagineTV]
>
> *Mikael Ståldal*
> Senior software developer
>
> *Magine TV*
> mikael.staldal@magine.com
> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>
> Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>



-- 
Matt Sicker <bo...@gmail.com>