You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Dmitriy Neretin <dm...@googlemail.com> on 2016/10/04 12:11:10 UTC

Log4j2 generates zero-bytes files when disk runs out of space

Hello everyone,

I have a strange side effect when our disks run out of space. (I know it's
not a task of a logging framework and log4 is also not a cause of our
problem, but it is still a side effect of the log4j :))

Log4 (2.5) starts to generate 0-Byte files and these files will be
immediately "gunzipped". So at the end of a day I have 2-5 "real" log files
and some hundreds of 0-byte *.log and *.log.gz files.

Is this side effect already known? Is there some workaround for this
problem? It's not a really blocker but it is also not nice...

I thought it were possible to delete such files with IfAccumulatedFileSize
policy, but there is a check with IllegalParameterException (>=0)

My config file is attached.

Regards,
Dmitriy

P. S. CdllFileAppender extends
AbstractOutputStreamAppender<RollingFileManager>

Re: Log4j2 generates zero-bytes files when disk runs out of space

Posted by Dmitriy Neretin <dm...@googlemail.com>.
Thank you for the feedback! I'll try to upgrade.

Dmitriy

2016-10-04 17:02 GMT+02:00 Gary Gregory <ga...@gmail.com>:

> FYI: In 2.7 we have a new "createOnDemand" option.
>
> Gary
>
> On Tue, Oct 4, 2016 at 5:11 AM, Dmitriy Neretin <
> dmitriy.neretin@googlemail.com> wrote:
>
> > Hello everyone,
> >
> > I have a strange side effect when our disks run out of space. (I know
> it's
> > not a task of a logging framework and log4 is also not a cause of our
> > problem, but it is still a side effect of the log4j :))
> >
> > Log4 (2.5) starts to generate 0-Byte files and these files will be
> > immediately "gunzipped". So at the end of a day I have 2-5 "real" log
> files
> > and some hundreds of 0-byte *.log and *.log.gz files.
> >
> > Is this side effect already known? Is there some workaround for this
> > problem? It's not a really blocker but it is also not nice...
> >
> > I thought it were possible to delete such files with
> IfAccumulatedFileSize
> > policy, but there is a check with IllegalParameterException (>=0)
> >
> > My config file is attached.
> >
> > Regards,
> > Dmitriy
> >
> > P. S. CdllFileAppender extends AbstractOutputStreamAppender<
> > RollingFileManager>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

Re: Log4j2 generates zero-bytes files when disk runs out of space

Posted by Gary Gregory <ga...@gmail.com>.
FYI: In 2.7 we have a new "createOnDemand" option.

Gary

On Tue, Oct 4, 2016 at 5:11 AM, Dmitriy Neretin <
dmitriy.neretin@googlemail.com> wrote:

> Hello everyone,
>
> I have a strange side effect when our disks run out of space. (I know it's
> not a task of a logging framework and log4 is also not a cause of our
> problem, but it is still a side effect of the log4j :))
>
> Log4 (2.5) starts to generate 0-Byte files and these files will be
> immediately "gunzipped". So at the end of a day I have 2-5 "real" log files
> and some hundreds of 0-byte *.log and *.log.gz files.
>
> Is this side effect already known? Is there some workaround for this
> problem? It's not a really blocker but it is also not nice...
>
> I thought it were possible to delete such files with IfAccumulatedFileSize
> policy, but there is a check with IllegalParameterException (>=0)
>
> My config file is attached.
>
> Regards,
> Dmitriy
>
> P. S. CdllFileAppender extends AbstractOutputStreamAppender<
> RollingFileManager>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory