You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Ronko (JIRA)" <ji...@apache.org> on 2014/03/18 04:15:44 UTC
[jira] [Commented] (LOG4J2-461) ERROR StatusLogger Unable to
locate a logging implementation, using SimpleLogger
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13938730#comment-13938730 ]
Ronko commented on LOG4J2-461:
------------------------------
Hi guys,
I have been just tripping over this and the error in LOG4J2-460. I tried to use log4j2 in a project last year, was hoping would be more stable by now, but been at it hours, and cannot get log4j2 to work.
I am using 2.0-rc1.
Maven builds (while executing plugins) are failing with these mentioned errors. I really think this is still a significant issue. When trying to executing mvn command line to build a jar, these errors occur.
>mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Service Client 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ service-client ---
[INFO] Deleting /git/common/common/service-client/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ service-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ service-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 15 source files to /git/common/common/service-client/target/classes
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.305s
[INFO] Finished at: Mon Mar 17 23:05:17 EDT 2014
[INFO] Final Memory: 21M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project
service-client: Fatal error compiling: java.lang.ExceptionInInitializerError:
org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
As you can see, it fails during the maven-compiler-plugin. I have tried adding the dependencies to the plugin, but no change.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-rc1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.0-rc1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-rc1</version>
</dependency>
</dependencies>
</plugin>
Using java 1.7.0_51, OSX 10.9.2, Maven 3.1.1.
> ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
> ---------------------------------------------------------------------------------
>
> Key: LOG4J2-461
> URL: https://issues.apache.org/jira/browse/LOG4J2-461
> Project: Log4j 2
> Issue Type: Bug
> Components: API
> Affects Versions: 2.0-beta9
> Environment: Android
> Reporter: Gaurav Kapoor
> Priority: Blocker
>
> ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
> Code:
> Logger LOG = LogManager.getLogger(MainActivity.class);
> LOG.error("Test Log4j2");
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration>
> <Appenders>
> <Console name="STDOUT" target="SYSTEM_OUT">
> <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
> </Console>
> </Appenders>
> <Loggers>
> <Logger name="hello" level="info"/>
> <Root level="trace">
> <AppenderRef ref="STDOUT"/>
> </Root>
> </Loggers>
> </Configuration>
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org