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

Nikita Mikhailov edited comment on LOG4J2-3060 at 4/3/21, 12:49 PM:
--------------------------------------------------------------------

Hm. In our case we managed to just call _.setHandler()_, doesn't this resolve 
the issue?

[https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java#L260]
 There already is a method that allows you to configure errorHandler 
post-construction. This indeed seems odd to configure it this way, but I fail 
to see how these issues are related at all.

In the case of AbstractAppender you can call this method in the constructor of 
the superclass before it is started


was (Author: noobgam):
Hm. In our case we managed to just call `.setHandler()`, doesn't this resolve 
the issue?

[https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java#L260]
There already is a method that allows you to configure errorHandler 
post-construction. This indeed seems odd to configure it this way, but I fail 
to see how these issues are related at all.

In the case of AbstractAppender you can call this method in the constructor of 
superclass

> Integer overflow in DefaultErrorHandler
> ---------------------------------------
>
>                 Key: LOG4J2-3060
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3060
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.14.1
>            Reporter: Nikita Mikhailov
>            Priority: Major
>
> When DefaultErrorHandler::error is being called often this leads to high CPU 
> consumption and `stdout` being trashed with messages because exceptionCount 
> is being incremented on every call and will eventually overflow and become 
> negative



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to