Log4j 2
  1. Log4j 2
  2. LOG4J2-379

Problem using log4j2 in Google App Engine

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta8
    • Fix Version/s: 2.0-rc1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Google App Engine

      Description

      [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
      

      This seems to be caused by the OnStartupTriggeringPolicy class initializing a static field with this code:

      private static final long JVM_START_TIME = ManagementFactory.getRuntimeMXBean().getStartTime();
      

      Is there a workaround for this?

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Remko Popma
            Reporter:
            Remko Popma
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development