Why is my Layout header not consistently writing?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Why is my Layout header not consistently writing?

Paul Benedict-2
Good day.

All my File Appenders have Pattern Layouts that specify both "header" and
"footer" attributes. I use these (ex: === START and === END) to bookend
process executions  Executions happen multiple times of day, and I am
always appending to the logs.

This isn't working for me. I am experiencing the unexpected:
1) The header is *only* written if the file must be created.
2) The footer is always written.

So my log files show one header and tons of footers.

Can someone please advise?

Cheers and God bless,
Paul
Reply | Threaded
Open this post in threaded view
|

Re: Why is my Layout header not consistently writing?

Ralph Goers
My expectation is that a header is written when the file is first created and is empty and the footer is appended when the file is closed before a rollover. I suspect the first behavior is implemented but the footer is being written on every close. Unfortunately it has to do that to behave correctly since it has no way to know if it will ever be written to again.

To be consistent the header should be written every time the file is opened. But that may not be what you want.

Ralph

> On Jun 11, 2019, at 1:44 PM, Paul Benedict <[hidden email]> wrote:
>
> Good day.
>
> All my File Appenders have Pattern Layouts that specify both "header" and
> "footer" attributes. I use these (ex: === START and === END) to bookend
> process executions  Executions happen multiple times of day, and I am
> always appending to the logs.
>
> This isn't working for me. I am experiencing the unexpected:
> 1) The header is *only* written if the file must be created.
> 2) The footer is always written.
>
> So my log files show one header and tons of footers.
>
> Can someone please advise?
>
> Cheers and God bless,
> Paul



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Why is my Layout header not consistently writing?

Gary Gregory-4
I can imagine how this bug would be a pain to fix: the appender opens a
file, may not log anything, and before closing it, reads the end of the
file and decides if the footer is already there. Arg.

Gary

On Tue, Jun 11, 2019 at 8:38 PM Ralph Goers <[hidden email]>
wrote:

> My expectation is that a header is written when the file is first created
> and is empty and the footer is appended when the file is closed before a
> rollover. I suspect the first behavior is implemented but the footer is
> being written on every close. Unfortunately it has to do that to behave
> correctly since it has no way to know if it will ever be written to again.
>
> To be consistent the header should be written every time the file is
> opened. But that may not be what you want.
>
> Ralph
>
> > On Jun 11, 2019, at 1:44 PM, Paul Benedict <[hidden email]> wrote:
> >
> > Good day.
> >
> > All my File Appenders have Pattern Layouts that specify both "header" and
> > "footer" attributes. I use these (ex: === START and === END) to bookend
> > process executions  Executions happen multiple times of day, and I am
> > always appending to the logs.
> >
> > This isn't working for me. I am experiencing the unexpected:
> > 1) The header is *only* written if the file must be created.
> > 2) The footer is always written.
> >
> > So my log files show one header and tons of footers.
> >
> > Can someone please advise?
> >
> > Cheers and God bless,
> > Paul
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Why is my Layout header not consistently writing?

Paul Benedict-2
Gary, but the reverse is happening too. The appender opens a file, may not
log anything, and still writes the footer. It's endless amounts of footers
with just one header.

Cheers and God bless,
Paul


On Tue, Jun 11, 2019 at 9:00 PM Gary Gregory <[hidden email]> wrote:

> I can imagine how this bug would be a pain to fix: the appender opens a
> file, may not log anything, and before closing it, reads the end of the
> file and decides if the footer is already there. Arg.
>
> Gary
>
> On Tue, Jun 11, 2019 at 8:38 PM Ralph Goers <[hidden email]>
> wrote:
>
> > My expectation is that a header is written when the file is first created
> > and is empty and the footer is appended when the file is closed before a
> > rollover. I suspect the first behavior is implemented but the footer is
> > being written on every close. Unfortunately it has to do that to behave
> > correctly since it has no way to know if it will ever be written to
> again.
> >
> > To be consistent the header should be written every time the file is
> > opened. But that may not be what you want.
> >
> > Ralph
> >
> > > On Jun 11, 2019, at 1:44 PM, Paul Benedict <[hidden email]>
> wrote:
> > >
> > > Good day.
> > >
> > > All my File Appenders have Pattern Layouts that specify both "header"
> and
> > > "footer" attributes. I use these (ex: === START and === END) to bookend
> > > process executions  Executions happen multiple times of day, and I am
> > > always appending to the logs.
> > >
> > > This isn't working for me. I am experiencing the unexpected:
> > > 1) The header is *only* written if the file must be created.
> > > 2) The footer is always written.
> > >
> > > So my log files show one header and tons of footers.
> > >
> > > Can someone please advise?
> > >
> > > Cheers and God bless,
> > > Paul
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>