quarks
quarks

Reputation: 35346

Problems with using Log4j 2 in GAE

I just migrated all the java.util.logging codes to log4j in my GAE/J app however I am getting this error:

[INFO] Caused by: java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google  App Engine developer's guide for more details.
[INFO]  at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
[INFO]  at org.apache.logging.log4j.core.appender.rolling.OnStartupTriggeringPolicy.<clinit>(OnStartupTriggeringPolicy.java:33)
[INFO]  at java.lang.Class.forName0(Native Method)
[INFO]  at java.lang.Class.forName(Class.java:186)
[INFO]  at org.apache.logging.log4j.core.config.plugins.PluginManager.decode(PluginManager.java:222

Is there a work-around for this?

The dependency for the Log4j is through:

    <dependency>
        <groupId>org.apache.onami.logging</groupId>
        <artifactId>org.apache.onami.logging.log4j2</artifactId>
        <version>3.4.0-incubating</version>
    </dependency>

Upvotes: 2

Views: 900

Answers (1)

Remko Popma
Remko Popma

Reputation: 36844

You can disable JMX in log4j2 by setting system property: log4j2.disable.jmx=true. http://logging.apache.org/log4j/2.x/manual/jmx.html

Upvotes: 1

Related Questions