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 "Remko Popma (JIRA)" <ji...@apache.org> on 2013/09/23 05:16:07 UTC

[jira] [Resolved] (LOG4J2-379) Problem using log4j2 in Google App Engine

     [ https://issues.apache.org/jira/browse/LOG4J2-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma resolved LOG4J2-379.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-rc1

I went ahead and made this change; it may not be perfect but it is better than what we have now (where log4j doesn't work at all in GAE). The change includes a note in the docs for OnStartup rollover trigger.

I've only been able to verify that OnStartupTriggeringPolicy still works _outside_ GAE. Can someone verify this solves the problem when running in GAE?

Fixed in revision 1525494.
Please verify and close.
                
> Problem using log4j2 in Google App Engine
> -----------------------------------------
>
>                 Key: LOG4J2-379
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-379
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0-beta8
>         Environment: Google App Engine
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.0-rc1
>
>
> {code}
> [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
> {code}
> This seems to be caused by the {{OnStartupTriggeringPolicy}} class initializing a static field with this code:
> {code}
> private static final long JVM_START_TIME = ManagementFactory.getRuntimeMXBean().getStartTime();
> {code}
> Is there a workaround for this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org