logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Constantin Ungureanu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1267) AsyncLogger.stop() method is needed
Date Fri, 12 Feb 2016 12:56:18 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15144542#comment-15144542
] 

Constantin Ungureanu commented on LOG4J2-1267:
----------------------------------------------

I want to flush on disk any existing logs and stop the logging subsystem altogether before
terminating my application. If I don't stop the disruptor it throws that exception. 

I tried {{((LifeCycle) LogManager.getContext()).stop();}} with version 2.5 but I get the same
exception. If I use this with version 2.4.1, it gets to call AsyncLogger.stop() and that it
is working. I see that {{stop}} method in 2.5 version moved into AsyncLoggerDisruptor, but
it slightly changed and now it is faulty. I didn't had time to investigate this, if it is
the {{stop()}} body method changes or the change from a static method (and a statically declared
disruptor) to an instance one that cause this issue, I suspect is one of those.

{{LogManager.shutdown();}} would be an elegant solution, I would like that.




> AsyncLogger.stop() method is needed
> -----------------------------------
>
>                 Key: LOG4J2-1267
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1267
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.5
>            Reporter: Constantin Ungureanu
>
> The AsyncLogger.stop() method was used to prevent the exception bellow. Now with the
2.5 version, this was removed. Is there a workaround to fix this?
> {code}
> Feb 10, 2016 8:43:59 PM com.lmax.disruptor.FatalExceptionHandler handleEventException
> SEVERE: Exception processing: 557627 org.apache.logging.log4j.core.async.RingBufferLogEvent@45c7b5da
> java.lang.InterruptedException
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown
Source)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
Source)
>         at com.lmax.disruptor.BlockingWaitStrategy.waitFor(BlockingWaitStrategy.java:45)
>         at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:56)
>         at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:124)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>         at java.lang.Thread.run(Unknown Source)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message