[logback-dev] [JIRA] (LOGBACK-1286) Add discardWhenFull config option to AsyncAppender

QOS.CH (JIRA) noreply-jira at qos.ch
Mon Mar 20 23:51:00 CET 2017


Scott Wilson created LOGBACK-1286:
-------------------------------------

             Summary: Add discardWhenFull config option to AsyncAppender
                 Key: LOGBACK-1286
                 URL: https://jira.qos.ch/browse/LOGBACK-1286
             Project: logback
          Issue Type: Improvement
          Components: logback-classic
    Affects Versions: 1.1.11
            Reporter: Scott Wilson
            Assignee: Logback dev list


The current AsyncAppender implementation blocks once the queue is full. In some situations the user would rather lose log messages than block on the log call. It would be very helpful to make this configurable.

My current workaround is to create a class that extends AsyncAppenderBase and overrides the append() method and calls blockingQueue.offer() instead of put().

Suggested solution:
 # Add a configurable attribute such as discardWhenFull that defaults to false
 # In AsyncAppenderBase.append() use blockingQueue.offer() if discardWhenFull is true



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the logback-dev mailing list