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 <garydgreg...@gmail.com> 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 <ralph.go...@dslextreme.com>
> 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 <pbened...@apache.org>
> 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: log4j-user-unsubscr...@logging.apache.org
> > For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >
> >
>

Reply via email to