Quantcast

log4j not working in weblogic 10

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

log4j not working in weblogic 10

Ken Liu
Hi everyone -

I'm not getting any output from log4j when I deploy a WAR file on
Weblogic 10. It works fine in Jetty (via run-app).

I have the following set in weblogic.xml, which should theoretically
tell Weblogic to load log4j from the WAR file instead of from the
system classpath.
 <prefer-web-inf-classes>true</prefer-web-inf-classes>

Before I dive into classloader hell, does anyone have any simple
solutions for getting log4j working with Grails (1.1.1) on Weblogic
10? My Google fu is not turning up anything.

Thanks,

Ken

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: log4j not working in weblogic 10

houbie
We're also deploying on weblogic 10, but we cannot use the <prefer-web-inf-classes> (it causes more class loading problems than it solves).

Therefore we implemented or own log4j config loader and put it in the web.xml template:
    <listener>
        <listener-class>our.own.Log4jConfigServletContextListener</listener-class>
    </listener>

This listener knows where to find an external log4j.properties file and loads it:
Log4jConfigHelper.configure(getLog4JPropertiesFile(),  scanInterval);

The Log4jConfigHelper configures log4j itself:
PropertyConfigurator.configureAndWatch(file, scanInterval);

For development outside weblogic, we have in Config.groovy:
        log4j = {
            Log4jConfigHelper.configure(getDevLog4jPropertiesFile(), 2)
        }

Grtz,
Ivo




On 14 Oct 2010, at 17:06, Ken Liu wrote:

> Hi everyone -
>
> I'm not getting any output from log4j when I deploy a WAR file on
> Weblogic 10. It works fine in Jetty (via run-app).
>
> I have the following set in weblogic.xml, which should theoretically
> tell Weblogic to load log4j from the WAR file instead of from the
> system classpath.
> <prefer-web-inf-classes>true</prefer-web-inf-classes>
>
> Before I dive into classloader hell, does anyone have any simple
> solutions for getting log4j working with Grails (1.1.1) on Weblogic
> 10? My Google fu is not turning up anything.
>
> Thanks,
>
> Ken
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

Ivo Houbrechts

Veldstraat 50
2460 Lichtaart
tel: +32 476 367360


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: log4j not working in weblogic 10

wdbetts
This post has NOT been accepted by the mailing list yet.
We add this to our server startup:
-Dlog4j.configuration=file:///opt/.../log4j.xml
Loading...