java - log4j2 - Root contains an invalid element or attribute -


trying use sample xml file "sample 1 / log4j 2 xml configuration" page:

http://logging.apache.org/log4j/2.x/manual/migration.html

but gives:

2013-09-25 02:22:59,182 error root contains invalid element or attribute "appenderref" 

any ideas?

i using dependency in pom.xml,

<dependency>     <groupid>org.apache.logging.log4j</groupid>     <artifactid>log4j-core</artifactid>     <version>2.0-beta8</version> </dependency> 

and use inside class:

private static final logger logger = logmanager.getlogger(app.class.getname()); 

and specify config file follows:

java -dlog4j.configurationfile=log4j2.xml -jar target/project-jar-with-dependencies.jar 

this error 2.0-beta8, not present on 2.0-beta9

here output using beta9

        log.debug("log4j impl test started...");         log.warn("  log4j impl test warn...");         log.info("  log4j impl test info...");         log.error("  log4j impl test error..."); ... 2013-09-24 16:37:39,841 debug [main] log4jimpltest (log4jimpltest.java:21) - log4j impl test started... 2013-09-24 16:37:39,843 warn  [main] log4jimpltest (log4jimpltest.java:22) -   log4j impl test warn... 2013-09-24 16:37:39,843 info  [main] log4jimpltest (log4jimpltest.java:23) -   log4j impl test info... 2013-09-24 16:37:39,843 error [main] log4jimpltest (log4jimpltest.java:24) -   log4j impl test error... 

here output using beta8:

2013-09-24 16:39:28,233 error root contains invalid element or attribute "appenderref" 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -