You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jochen Rieß <jo...@uni-dortmund.de> on 2007/08/17 20:31:26 UTC

How to use Log4j in own axis2 service?

Hello everybody,

I've deployed a simple web service that uses the log4j library for the 
logging. I want everything from this service written into a single 
logfile. My service .aar has the following structure:

--service.aar
----log4j.properties
----de.evision..... (class files are here)
----lib
------log4j.jar
------(other libs)

The Service works fine, but no log output is written.
My log4j properties file looks like:

# log4j.rootLogger=DEBUG, file
log4j.logger.de.evision=DEBUG, file
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.datePattern='.'yyyy-MM-dd
log4j.appender.file.file=/tmp/mylogfile.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - 
%m%n

I've tried several file locations, using the exact same log4j 
configuration works for a servlet running inside the tomcat container 
which also holds axis2.
I've tried it with and without the rootLogger set to Debug/file..

Any suggestions?

Thanks for your time,
Jochen Rieß



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: How to use Log4j in own axis2 service?

Posted by Anthony Bull <an...@bcsoft.co.nz>.
Hi Jochen,

for logging to work in my services, I have been having to invoke log4j 
programmatically either from my service skeleton or from the message 
receiver.

Properties props = new Properties();
props.load( ServiceSkeleton.class.getClassLoader().getResourceAsStream( 
"log4j.properties"));
PropertyConfigurator.configure( props);

cheers,
Ants.

Jochen Rieß wrote:
> Hello everybody,
>
> I've deployed a simple web service that uses the log4j library for the 
> logging. I want everything from this service written into a single 
> logfile. My service .aar has the following structure:
>
> --service.aar
> ----log4j.properties
> ----de.evision..... (class files are here)
> ----lib
> ------log4j.jar
> ------(other libs)
>
> The Service works fine, but no log output is written.
> My log4j properties file looks like:
>
> # log4j.rootLogger=DEBUG, file
> log4j.logger.de.evision=DEBUG, file
> log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.file.datePattern='.'yyyy-MM-dd
> log4j.appender.file.file=/tmp/mylogfile.log
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L 
> - %m%n
>
> I've tried several file locations, using the exact same log4j 
> configuration works for a servlet running inside the tomcat container 
> which also holds axis2.
> I've tried it with and without the rootLogger set to Debug/file..
>
> Any suggestions?
>
> Thanks for your time,
> Jochen Rieß
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>


-- 
Anthony
-------------------------------------
Anthony Bull
Senior Developer
Black Coffee Software Ltd
PO Box 10-192 The Terrace
Wellington, New Zealand

anthony.bull@bcsoft.co.nz
Ph  +64 4 472 8818
Fax +64 4 472 8811
Mobile 021 303 692
-------------------------------------
www.bcsoft.co.nz
---------------------------------------------------------------
This email may contain confidential or privileged information,
and is intended for use only by the addressee, or addressees.
If you are not the intended recipient please advise the sender
immediately and do not copy, use or disclose the contents to
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses
received with this email, or to any changes made to the original
content. Any views or opinions expressed in this email may be
personal to the sender and are not necessarily those of Black
Coffee Software Ltd.
---------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org