logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "St Ledger, John W" <stled...@lanl.gov>
Subject Re: how to detect logger is unable to write to file?
Date Thu, 29 Oct 2015 20:48:29 GMT
Lou,

I don't know if this will help, but it is a daily rolling file appender that keeps a maximum
of 6 log files. Rollover occurs at midnight, and if more that 6 log files exist, then the
oldest is deleted.

You still can't tell if the logger fails to write to a file, but if your quota is number of
files, then this approach might help.

John

John W St. Ledger
Los Alamos National Laboratory

From: Matt Sicker <boards@gmail.com<mailto:boards@gmail.com>>
Reply-To: Log4J Users List <log4j-user@logging.apache.org<mailto:log4j-user@logging.apache.org>>
Date: Thursday, October 29, 2015 2:32 PM
To: Log4J Users List <log4j-user@logging.apache.org<mailto:log4j-user@logging.apache.org>>
Subject: Re: how to detect logger is unable to write to file?

There's the FailoverAppender <
http://logging.apache.org/log4j/2.x/manual/appenders.html#FailoverAppender>
that gives you a way to automatically switch to a different appender when
the primary one errs.

On 29 October 2015 at 12:21, degenaro <lou.degenaro@gmail.com<mailto:lou.degenaro@gmail.com>>
wrote:

We use log4j with rolling appenders for daemons that run 24x7.  The daemons
run as a user on linux and the log files are written to a filesystem that
has a quota.  Normally this works great.  Once in a while (usually due to
human error) the quota is exceeded.  This, unfortunately, prevents the
daemons from writing their logs...worst of all silently.  There is no
indication that anything is wrong!

So my question is: how do we configure log4j so that when logging (to file)
fails the daemon can find out and take appropriate action?



--
View this message in context:
http://apache-logging.6191.n7.nabble.com/how-to-detect-logger-is-unable-to-write-to-file-tp59123.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org<mailto:log4j-user-unsubscribe@logging.apache.org>
For additional commands, e-mail: log4j-user-help@logging.apache.org<mailto:log4j-user-help@logging.apache.org>




--
Matt Sicker <boards@gmail.com<mailto:boards@gmail.com>>


Mime
View raw message