Hi All and Piotr mostly (since you did the 2.x code in Commons Logging),

[ Background: My reply
https://lists.apache.org/thread/rcxkfffg9pfj9662d1fxlyo4l8cv2yyq to
the post https://lists.apache.org/thread/w5yq2locvdt8yhf8k9075vgjg1kw5569
]

In my branch 
https://github.com/garydgregory/commons-logging/tree/log4j1-log42-api
I have test failures where all 6 events are logged instead of 4 by the
existing test that calls (mvn clean verify): Unexpected number of log
events expected:<4> but was:<6> based on:

    private void logPlainMessages(final Log log) {
        log.trace("trace"); // Should not actually get logged
        log.debug("debug"); // Should not actually get logged
        log.info("info");
        log.warn("warn");
        log.error("error");
        log.fatal("fatal");
    }

It turns out that I see this in the test resources, log4j2-test.xml:

<Configuration>
    <Appenders>
        <List name="LIST"/>
    </Appenders>
    <Loggers>
        <Root level="TRACE">
            <AppenderRef ref="LIST"/>
        </Root>
    </Loggers>
</Configuration>

I can understand that the above v2 file does not kick in before my
branch since the problematic test is a v1 test. But, now that this
test ends up using the 1.2-api bridge, the file is in play.

How do I make the 1.x test point to a different file so that the code
passes as is?

TY,
Gary

Reply via email to