[jboss-jira] [JBoss JIRA] (WFLY-4178) Logging async-handler improvement - report number dropped logs

Todd Sandor (JIRA) issues at jboss.org
Fri Dec 12 10:28:29 EST 2014


Todd Sandor created WFLY-4178:
---------------------------------

             Summary: Logging async-handler improvement - report number dropped logs
                 Key: WFLY-4178
                 URL: https://issues.jboss.org/browse/WFLY-4178
             Project: WildFly
          Issue Type: Enhancement
          Components: Logging
    Affects Versions: 8.0.0.Final
            Reporter: Todd Sandor
            Assignee: James Perkins


The functional requirement is to know when logs are discarded and the number of logs discarded.  

When using a async-handler such as the one below, we do not know if/when logs are discarded, thousands could be dropped and we do not know it.

            <async-handler name="ASYNC">
                <queue-length value="300000"/>
                <overflow-action value="discard"/>
                <subhandlers>
                    <handler name="FILE"/>
                </subhandlers>
            </async-handler>

Potential solution/suggestion:
Add a new property, call it max-discard-logs, with a default value of 1 - uses existing behavior when = 1 (when queue full, drop any new log).
When > 1 and queue is full, at least max-discard-logs logs are removed from the queue and display a log indicating the queue is full an N logs were dropped.

            <async-handler name="ASYNC">
                <queue-length value="300000"/>
                <overflow-action value="discard"/>
                <max-discard-logs value="1000"/>
                <subhandlers>
                    <handler name="FILE"/>
                </subhandlers>
            </async-handler>

Depending upon the type of queue being used in the implementation, this could be a very simple change.  
e.g
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html

int 	drainTo(Collection<? super E> c, int maxElements)
Removes at most the given number of available elements from this queue and adds them to the given collection.





--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list