failing to configure with configuration file in Eclipse

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

failing to configure with configuration file in Eclipse

Erik Itter
Hello,

I guess I am missing something basic...

I want my Eclipse Java project to log with log4j2 and it does with the
default configuration but does not use my log4j2.xml.

- added a lib folder as source folder in Eclipse and put
log4j-1.2-api-2.11.2.jar and log4j-core-2.11.2.jar there.
- put log4j2.xml in the same directory (as the default logging works it has
to be on the classpath I think)

contents:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
    <Appenders>
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout
                pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1}
- %msg%n" />
        </Console>
    </Appenders>
    <Loggers>
        <Root level="debug" additivity="false">
            <AppenderRef ref="console" />
        </Root>
    </Loggers>
</Configuration>


does still use the default configuration ignoring the configuration file.


any hints welcome.

best regards