You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2017/03/01 22:58:45 UTC

[jira] [Comment Edited] (LOG4J2-1761) Support for standard java queues for the async logger

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

Remko Popma edited comment on LOG4J2-1761 at 3/1/17 10:58 PM:
--------------------------------------------------------------

You can get some of the advantages by using AsyncAppender. You can select the queue implementation when you use AsyncAppender. 

Async Loggers are faster than AsyncAppender in multithreaded scenarios because of the Disruptor. Building Async Loggers without the Disruptor would be pointless.  If you don't want to use the Disruptor please use AsyncAppender. 

About the overflow, you may be right (I haven't checked). How often can this happen? Assuming you are logging 100 million events per second, how long does it take to overflow a 64 bit long? 


was (Author: remkop@yahoo.com):
You can get some of the advantages by using AsyncAppender. You can select the queue implementation when you use AsyncAppender. 

AsyncAppender Loggers are faster in multithreaded scenarios because of the Disruptor. If you don't want to use it please use AsyncAppender. 

About the overflow, you may be right (I haven't checked). How often can this happen? Assuming you are logging 100 million events per second, how long does it take to overflow a 64 bit long? 

> Support for standard java queues for the async logger
> -----------------------------------------------------
>
>                 Key: LOG4J2-1761
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1761
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.7
>            Reporter: Kim Northrop
>            Priority: Minor
>         Attachments: AsyncLogEvent.java, AsyncLoggerWithQueueContext.java, AsyncLoggerWithQueueContextSelector.java, AsyncLoggerWithQueue.java, QueueWrapperCLQ.java, QueueWrapper.java, QueueWrapperLBQ.java, QueueWrapperLTQ.java
>
>
> Please add support for standard java queues (LinkedTransferQueue, ArrayBlockingQueue, LinkedBlockingQueue, ConcurrentLinkedQueue) to the async logger. I will attach some classes for usage with System properties (Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerWithQueueContextSelector, LoggerQueue.Capacity=<capacity>, LoggerQueue.Type=<currently one of LinkedTransferQueue, ConcurrentLinkedQueue, LinkedBlockingQueue>). Since most of these queues allocate new nodes for new elements I have not implemented usage of thread locals for the log events.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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