[
https://issues.apache.org/jira/browse/LOG4J2-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17203275#comment-17203275
]
Gary D. Gregory edited comment on LOG4J2-2937 at 9/28/20, 2:50 PM:
-------------------------------------------------------------------
What are we talking about here, more concretely? Adding something like:
org.apache.logging.log4j.Logger#getStatistics() where Statistics is an
interface that defines access to, initially, running counts? Per level?
Something like:
logger.getStatistics().getCount(Level.ERROR)?
Does this count events that are filtered out? Is there a different count for
calls to, for example to info() vs. a call to info() that is dropped on the
floor because a filter excludes it?
Should we also be able to count markers?
was (Author: garydgregory):
What are we talking about here, more concretely? Adding something like:
org.apache.logging.log4j.Logger#getStatistics() where Statistics is an
interface that defines access to, initially, running counts? Per level?
Something like:
logger.getStatistics().getCount(Level.ERROR)?
Does this count events that are filtered out? Is there a different count for
calls to, for example info() vs a call to info() that is dropped on the floor
because a filter excludes it?
Should we also be able to count markers?
> 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
>
> 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)