You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by JMan_JE <Jo...@gmx.net> on 2009/08/25 14:04:16 UTC

Using Log4J inside a simlpe frontend bean

Hello,

i have a bean published as a service using the simple frontend. It is hosted
in a tomcat container using the cxf servlet and the spring
ContextLoaderListener. I have log4j configured in the web.xml by adding 
<context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>file:C:/<path>/log4j.xml</param-value>
    </context-param>   
    
    <listener>
       
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

above the ContextLoaderListener. This way i see the cxf logging messages in
the configured logger. The Problem however is, that i do not see the
logmessages from my bean. In my bean i get a logger like this:
Logger.getLogger(Bean.class). The log4j-jar is inside my webapps lib folder.
Any ideas whats wrong here?

Thanks for any hints,
Johannes
-- 
View this message in context: http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25132933.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: Using Log4J inside a simple frontend bean

Posted by JMan_JE <Jo...@gmx.net>.
Thanks for your reply, I actually figured it out:
http://forum.springsource.org/showthread.php?t=76835

Thanks, Johannes


MBB wrote:
> 
> Okay, then, I suppose you could put an explicit call to
> DOMConfigurator.configure(filename) in the initialization of your bean. 
> Without seeing the whole setup I can't say how exactly to inject the
> filename into the bean, but it's probably fairly easy.  Does that help?
> 
> -----Original Message-----
> From: JMan_JE [mailto:JohannesElsinghorst@gmx.net] 
> Sent: Wednesday, August 26, 2009 1:24 PM
> To: users@cxf.apache.org
> Subject: RE: Using Log4J inside a simple frontend bean
> 
> 
> Yes, the IT-Guys running the app, want to have all config and logfiles in
> one
> configurable location.
> So any clues how to make this work?
> 
> Cheers, Johannes
> 
> 
> MBB wrote:
>> 
>> Just out of curiosity:  Is it important that you put the location of
>> log4j.xml in a context parameter?  If you put it anywhere in your
>> classpath (either under your WEB-INF/classes or in the Tomcat
>> common/classes directory) your webapps should pick it up.
>> 
>> -----Original Message-----
>> From: JMan_JE [mailto:JohannesElsinghorst@gmx.net] 
>> Sent: Tuesday, August 25, 2009 3:04 PM
>> To: users@cxf.apache.org
>> Subject: Using Log4J inside a simlpe frontend bean
>> 
>> 
>> Hello,
>> 
>> i have a bean published as a service using the simple frontend. It is
>> hosted
>> in a tomcat container using the cxf servlet and the spring
>> ContextLoaderListener. I have log4j configured in the web.xml by adding 
>> <context-param>
>>         <param-name>log4jConfigLocation</param-name>
>>         <param-value>file:C:/<path>/log4j.xml</param-value>
>>     </context-param>   
>>     
>>     <listener>
>>        
>> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
>>     </listener>
>> 
>> above the ContextLoaderListener. This way i see the cxf logging messages
>> in
>> the configured logger. The Problem however is, that i do not see the
>> logmessages from my bean. In my bean i get a logger like this:
>> Logger.getLogger(Bean.class). The log4j-jar is inside my webapps lib
>> folder.
>> Any ideas whats wrong here?
>> 
>> Thanks for any hints,
>> Johannes
>> -- 
>> View this message in context:
>> http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25132933.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25150150.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25209746.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: Using Log4J inside a simple frontend bean

Posted by Michael Berkowitz <mb...@xconnect.net>.
Okay, then, I suppose you could put an explicit call to DOMConfigurator.configure(filename) in the initialization of your bean.  Without seeing the whole setup I can't say how exactly to inject the filename into the bean, but it's probably fairly easy.  Does that help?

-----Original Message-----
From: JMan_JE [mailto:JohannesElsinghorst@gmx.net] 
Sent: Wednesday, August 26, 2009 1:24 PM
To: users@cxf.apache.org
Subject: RE: Using Log4J inside a simple frontend bean


Yes, the IT-Guys running the app, want to have all config and logfiles in one
configurable location.
So any clues how to make this work?

Cheers, Johannes


MBB wrote:
> 
> Just out of curiosity:  Is it important that you put the location of
> log4j.xml in a context parameter?  If you put it anywhere in your
> classpath (either under your WEB-INF/classes or in the Tomcat
> common/classes directory) your webapps should pick it up.
> 
> -----Original Message-----
> From: JMan_JE [mailto:JohannesElsinghorst@gmx.net] 
> Sent: Tuesday, August 25, 2009 3:04 PM
> To: users@cxf.apache.org
> Subject: Using Log4J inside a simlpe frontend bean
> 
> 
> Hello,
> 
> i have a bean published as a service using the simple frontend. It is
> hosted
> in a tomcat container using the cxf servlet and the spring
> ContextLoaderListener. I have log4j configured in the web.xml by adding 
> <context-param>
>         <param-name>log4jConfigLocation</param-name>
>         <param-value>file:C:/<path>/log4j.xml</param-value>
>     </context-param>   
>     
>     <listener>
>        
> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
>     </listener>
> 
> above the ContextLoaderListener. This way i see the cxf logging messages
> in
> the configured logger. The Problem however is, that i do not see the
> logmessages from my bean. In my bean i get a logger like this:
> Logger.getLogger(Bean.class). The log4j-jar is inside my webapps lib
> folder.
> Any ideas whats wrong here?
> 
> Thanks for any hints,
> Johannes
> -- 
> View this message in context:
> http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25132933.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25150150.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: Using Log4J inside a simple frontend bean

Posted by JMan_JE <Jo...@gmx.net>.
Yes, the IT-Guys running the app, want to have all config and logfiles in one
configurable location.
So any clues how to make this work?

Cheers, Johannes


MBB wrote:
> 
> Just out of curiosity:  Is it important that you put the location of
> log4j.xml in a context parameter?  If you put it anywhere in your
> classpath (either under your WEB-INF/classes or in the Tomcat
> common/classes directory) your webapps should pick it up.
> 
> -----Original Message-----
> From: JMan_JE [mailto:JohannesElsinghorst@gmx.net] 
> Sent: Tuesday, August 25, 2009 3:04 PM
> To: users@cxf.apache.org
> Subject: Using Log4J inside a simlpe frontend bean
> 
> 
> Hello,
> 
> i have a bean published as a service using the simple frontend. It is
> hosted
> in a tomcat container using the cxf servlet and the spring
> ContextLoaderListener. I have log4j configured in the web.xml by adding 
> <context-param>
>         <param-name>log4jConfigLocation</param-name>
>         <param-value>file:C:/<path>/log4j.xml</param-value>
>     </context-param>   
>     
>     <listener>
>        
> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
>     </listener>
> 
> above the ContextLoaderListener. This way i see the cxf logging messages
> in
> the configured logger. The Problem however is, that i do not see the
> logmessages from my bean. In my bean i get a logger like this:
> Logger.getLogger(Bean.class). The log4j-jar is inside my webapps lib
> folder.
> Any ideas whats wrong here?
> 
> Thanks for any hints,
> Johannes
> -- 
> View this message in context:
> http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25132933.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25150150.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: Using Log4J inside a simple frontend bean

Posted by Michael Berkowitz <mb...@xconnect.net>.
Just out of curiosity:  Is it important that you put the location of log4j.xml in a context parameter?  If you put it anywhere in your classpath (either under your WEB-INF/classes or in the Tomcat common/classes directory) your webapps should pick it up.

-----Original Message-----
From: JMan_JE [mailto:JohannesElsinghorst@gmx.net] 
Sent: Tuesday, August 25, 2009 3:04 PM
To: users@cxf.apache.org
Subject: Using Log4J inside a simlpe frontend bean


Hello,

i have a bean published as a service using the simple frontend. It is hosted
in a tomcat container using the cxf servlet and the spring
ContextLoaderListener. I have log4j configured in the web.xml by adding 
<context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>file:C:/<path>/log4j.xml</param-value>
    </context-param>   
    
    <listener>
       
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

above the ContextLoaderListener. This way i see the cxf logging messages in
the configured logger. The Problem however is, that i do not see the
logmessages from my bean. In my bean i get a logger like this:
Logger.getLogger(Bean.class). The log4j-jar is inside my webapps lib folder.
Any ideas whats wrong here?

Thanks for any hints,
Johannes
-- 
View this message in context: http://www.nabble.com/Using-Log4J-inside-a-simlpe-frontend-bean-tp25132933p25132933.html
Sent from the cxf-user mailing list archive at Nabble.com.