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 David <cm...@gmail.com> on 2008/07/14 02:06:04 UTC

[Axis2] Activate Log4j

Hi,

I made a webservice in Axis2 and it's working very well but now I would like
to put some log in it with log4j.
My firsts attempts didn't worked, what is the right way to implement log in
a webservice Axis2 ?
Modifiy axis2/web-inf/classes/log4j.properties ?

I already put a myLog4j.properties in tomcat/conf and put a
PropertyConfigurator.configure("/myLog4j.properties") in the constructor of
my webservice. Without results...

thx

Re: [Axis2] Activate Log4j

Posted by David Ojeda <do...@integra.la>.
Hello,

Use different appenders for each webservice implementation:
log4j.logger.my.ws.test = TRACE, Appender1
log4j.logger.my.otherws.test = TRACE, Appender2
... an so on...

You will run into trouble if both webservices use the same classes, for instance 
a my.utilclass...

Check the log4j documentation on Appenders for more info...

Bye

On Monday 14 July 2008 06:10:31 am David wrote:
> Thx, This is already done in webapps/axis2/WEB-INF/classes under tomcat,
> and I found my error, now I can log my WS by put this line in the
> webapps/axis2/WEB-INF/classes/log4j.properties :
> log4j.logger.my.ws.test=TRACE
>
> But all the logs of my service are written in the same logfile as all
> Axis2, so can I separate the log of my sources ?
>
> thx
>
>
> On Mon, Jul 14, 2008 at 11:39 AM, Jan Verstuyft
> <ja...@googlemail.com>
>
> wrote:
> > Hi David,
> >
> > If I'm right, Axis2 use common logging instead of log4j.  You can
> > override this by putting a commons-logging.properties beside your
> > log4j.properties with following content:
> >
> > org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogge
> >r
> >
> > So you redirect your common logging to log4j.
> >
> > Kind regards
> > Jan Verstuyft
> >
> > 2008/7/14 David <cm...@gmail.com>:
> > > Hi,
> > >
> > > I made a webservice in Axis2 and it's working very well but now I would
> >
> > like
> >
> > > to put some log in it with log4j.
> > > My firsts attempts didn't worked, what is the right way to implement
> > > log
> >
> > in
> >
> > > a webservice Axis2 ?
> > > Modifiy axis2/web-inf/classes/log4j.properties ?
> > >
> > > I already put a myLog4j.properties in tomcat/conf and put a
> > > PropertyConfigurator.configure("/myLog4j.properties") in the
> > > constructor
> >
> > of
> >
> > > my webservice. Without results...
> > >
> > > thx
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org



-- 
Ing. David Ojeda
Integra Consultores
Caracas, Venezuela

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


Re: [Axis2] Activate Log4j

Posted by David <cm...@gmail.com>.
Thx, This is already done in webapps/axis2/WEB-INF/classes under tomcat, and
I found my error, now I can log my WS by put this line in the
webapps/axis2/WEB-INF/classes/log4j.properties :
log4j.logger.my.ws.test=TRACE

But all the logs of my service are written in the same logfile as all Axis2,
so can I separate the log of my sources ?

thx


On Mon, Jul 14, 2008 at 11:39 AM, Jan Verstuyft <ja...@googlemail.com>
wrote:

> Hi David,
>
> If I'm right, Axis2 use common logging instead of log4j.  You can
> override this by putting a commons-logging.properties beside your
> log4j.properties with following content:
>
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
>
> So you redirect your common logging to log4j.
>
> Kind regards
> Jan Verstuyft
>
> 2008/7/14 David <cm...@gmail.com>:
> > Hi,
> >
> > I made a webservice in Axis2 and it's working very well but now I would
> like
> > to put some log in it with log4j.
> > My firsts attempts didn't worked, what is the right way to implement log
> in
> > a webservice Axis2 ?
> > Modifiy axis2/web-inf/classes/log4j.properties ?
> >
> > I already put a myLog4j.properties in tomcat/conf and put a
> > PropertyConfigurator.configure("/myLog4j.properties") in the constructor
> of
> > my webservice. Without results...
> >
> > thx
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: [Axis2] Activate Log4j

Posted by Jan Verstuyft <ja...@googlemail.com>.
Hi David,

If I'm right, Axis2 use common logging instead of log4j.  You can
override this by putting a commons-logging.properties beside your
log4j.properties with following content:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

So you redirect your common logging to log4j.

Kind regards
Jan Verstuyft

2008/7/14 David <cm...@gmail.com>:
> Hi,
>
> I made a webservice in Axis2 and it's working very well but now I would like
> to put some log in it with log4j.
> My firsts attempts didn't worked, what is the right way to implement log in
> a webservice Axis2 ?
> Modifiy axis2/web-inf/classes/log4j.properties ?
>
> I already put a myLog4j.properties in tomcat/conf and put a
> PropertyConfigurator.configure("/myLog4j.properties") in the constructor of
> my webservice. Without results...
>
> thx
>

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