[
https://issues.apache.org/jira/browse/LOG4J2-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13631774#comment-13631774
]
Henry Clout commented on LOG4J2-173:
------------------------------------
Further to this, when I made the mod I suggested to BurstFilter the test still
failed due to the burst filtering kicking in for tests that assumed it would
not. There seemed to be a number of issues expecting 110 results to be logged
when the burst size is configured to be 100, and a lack of sleeps between tests.
Also, the final test assumed logging would occur at debug level when in fact
debug logging should be filtered, so I changed this to make a .info call.
With these changes, the test with the suggested mod passes.
I'll attach the revised test -- let me know if you'd prefer a patch file.
> BurstFilter does not honour level
> ---------------------------------
>
> Key: LOG4J2-173
> URL: https://issues.apache.org/jira/browse/LOG4J2-173
> Project: Log4j 2
> Issue Type: Bug
> Components: Filters
> Affects Versions: 2.0-beta4
> Reporter: Henry Clout
> Attachments: BurstFilterTest.java
>
>
> I've been getting info (and below) logging out of the BurstFilter despite it
> being set to warn. The problem seems to be in the filter method, the test :
> if (this.level.isAtLeastAsSpecificAs(level)) {
> ... seems to be the wrong way around.
> I changed the method locally to be:
> private Result filter(final Level level) {
> if (level.isAtLeastAsSpecificAs(this.level)) {
> LogDelay delay = history.poll();
> while (delay != null) {
> available.add(delay);
> delay = history.poll();
> }
> delay = available.poll();
> if (delay != null) {
> delay.setDelay(burstInterval);
> history.add(delay);
> return onMatch;
> }
> return onMismatch;
> }
> return onMismatch;
> }
> Which seems to have the desired results.
> Does this make sense?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]