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

Ralph Goers commented on LOG4J2-2937:
-------------------------------------

@Remko, the idea of a callback is not appealing to me as it allows for the 
callback to be misused. This is going to be performance sensitive and we want 
almost zero overhead. Again, looking at Flume's model the counter classes are 
essentially MBeans that expose all the attributes. Custom Appenders, etc just 
extend the base MBean class and add extra bean methods for the attributes they 
want to collect. Callbacks can't do arbitrary things because they still have to 
record in the fields the Counter interface (the interface for the MBean) 
exposes.

[~dennysfredericci] Thanks for the very good explanation.  I do wonder why we 
call a filter multiple times.

> Provide counters to measure log rate
> ------------------------------------
>
>                 Key: LOG4J2-2937
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2937
>             Project: Log4j 2
>          Issue Type: New Feature
>            Reporter: Dennys Fredericci
>            Priority: Major
>         Attachments: image-2020-09-28-21-10-13-850.png
>
>
> As a Log4j API user will be really nice to have a way to get the number of 
> log calls for each level without any instrumentation or bytecode 
> manipulation, something native from log4j API.
> Once this interface is implemented this can be exposed through JMX or used by 
> other libraries to send the log rate to monitoring systems such as Datadog, 
> NewRelic, Dynatrace, etc.  :)



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

Reply via email to