Hi Guys!

I have some logging configuration staff using java api.
And migrating from log4j2 v2.2 to v2.8.2, I've got StackOverflowError
inside of Log4j logger.
The problem was finally resolved with configuration logic correction, but
it still seems to be a reason to fix something inside of Log4j to prevent
such cases.
Here is a simplified test code, which lead to the exception.

>>>>>
    @Test
    public void test1() throws FileNotFoundException, IOException {
        XmlConfiguration conf = new XmlConfiguration(
                LoggerContext.getContext(),
                new ConfigurationSource(new FileInputStream(
                        new File("log4j2.xml"))));

        ((LoggerContext) LogManager.getContext(false)).start(conf);

        Logger log = (Logger) LogManager.getLogger();
        log.getContext().start(conf);

        log.info("Hello world");
    }
<<<<<

This code is not fully correct, but it does not look like a criminal. So,
its not good that log4j fails on this.

Thanks.
-- 
WBR, Sergii

Reply via email to