logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From degenaro <lou.degen...@gmail.com>
Subject Re: how to detect logger is unable to write to file?
Date Fri, 30 Oct 2015 14:01:20 GMT
That's what I thought.  As I said, we are running several daemons and all
are using common code comprising log4j v1.  But one of the daemons does get
this exception:

java.io.IOException: Disk quota exceeded
        at java.io.FileOutputStream.write(FileOutputStream.java:329)
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)
        at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:303)
        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:307)
        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:153)
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:289)
        at org.apache.log4j.helpers.QuietWriter.flush(QuietWriter.java:59)
        at
org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:324)
        at
org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:276)
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)
        at
org.apache.uima.ducc.common.utils.DeferredOpenRollingAppender.append(DeferredOpenRollingAppender.java:37)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at org.apache.log4j.Category.forcedLog(Category.java:391)
        at org.apache.log4j.Category.log(Category.java:838)

Is this a bug in v1, since I understand that no Exception should be
reflected back until v2?  Stranger still, only one of the daemons see this
exception.  The others see nothing.

Lou.

On Thu, Oct 29, 2015 at 4:32 PM, Ralph Goers [via Apache Logging] <
ml-node+s6191n59133h63@n7.nabble.com> wrote:

> That feature is only in Log4j 2.
>
> Ralph
>
> > On Oct 29, 2015, at 1:18 PM, degenaro <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=59133&i=0>> wrote:
> >
> > This a quota on the filesystem.  Writes are blocked when the total
> > permitted bytes for the user is exceeded.  It looks like log4j2 might
> help
> > if an exception is being thrown.  I see that one can specify
> > ignoreException="false".
> >
> > We currently have log4j (not log4j2).  Is there the equivalent or is the
> > new function in 2 only?
> >
> > Lou.
> >
> > On Thu, Oct 29, 2015 at 4:09 PM, John St. Ledger [via Apache Logging] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=59133&i=1>>
> wrote:
> >
> >> 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 <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=0>>
> >> Reply-To: Log4J Users List <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=1>>
> >> Date: Thursday, October 29, 2015 2:32 PM
> >> To: Log4J Users List <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=2>>
> >> 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 <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=3>> 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: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=4>
> >> For additional commands, e-mail: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=5>
> >>
> >>
> >>
> >>
> >> --
> >> Matt Sicker <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=6>>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=7>
> >> For additional commands, e-mail: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=59129&i=8>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://apache-logging.6191.n7.nabble.com/how-to-detect-logger-is-unable-to-write-to-file-tp59123p59129.html
> >> To unsubscribe from how to detect logger is unable to write to file?,
> click
> >> here
> >> <
> >> .
> >> NAML
> >> <
> http://apache-logging.6191.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://apache-logging.6191.n7.nabble.com/how-to-detect-logger-is-unable-to-write-to-file-tp59123p59132.html
> > Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=59133&i=2>
> For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=59133&i=3>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-logging.6191.n7.nabble.com/how-to-detect-logger-is-unable-to-write-to-file-tp59123p59133.html
> To unsubscribe from how to detect logger is unable to write to file?, click
> here
> <http://apache-logging.6191.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=59123&code=bG91LmRlZ2VuYXJvQGdtYWlsLmNvbXw1OTEyM3w5MDEwOTIyNTY=>
> .
> NAML
> <http://apache-logging.6191.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-logging.6191.n7.nabble.com/how-to-detect-logger-is-unable-to-write-to-file-tp59123p59165.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message