2
votes

I have axis2 deployed to tomcat and in my web service project I create the aar and deploy it within axis 2 (rather tham compiling my webservice with axis2).

I log messages from my web service using log4j. This is fine locally as I hacked it into axis folder and have access to tomcat to restart.

I don't have this luxury in my deployment. How do I get my web service to pick up my log4j and not the one in log4j which presumably is getting found in the class path or even using tomcat's own?

I've read this: http://axis.apache.org/axis/java/developers-guide.html#Log4J

but I'm none the wiser.

thanks.

1
Don't you know how to set system property for : log4j.configuration=file:/home/fred/log4j.props or dont you have rights to change system properties in your server ?Sercan Ozdemir

1 Answers

0
votes

If you use the apache commons API, then it will automatically pick up log4j if it's on the class path. Otherwise it will use the logger built into the standard library. You'll generally need a -D parameter to set the logger to point at the appropriate configuration file. If you use the standard libraray logger then you can actually change the logger settings dynamically with jconsole.