I'm developing a simple web service using Apache, Tomcat 5, Axis 1.4
Instead of using System.out.println I'm trying to setup logging for
Axis. Unfortunately this is more complex than I expected. Basically,
for starters, I want to have the logging output go to the console (or
to a file). I've tried to use the java.util.logging package for this:
===========================================
import java.util.logging.Logger;
Logger logger = Logger.getLogger("MyLogger");
logger.addHandler(new ConsoleHandler());
logger.setLevel(java.util.logging.Level.FINEST);
logger.info("hello");
===========================================
This doesn't work.
What is the simplest way to setup logging in Axis? Am I on the right
track or should I use configuration files or so?
2B
cyberco - 18 Mar 2007 21:59 GMT
I'm still struggling with this. Anybody here that has any experience
with Axis and logging (or knows where I can post this question as
well)?
2B
Arne Vajhøj - 19 Mar 2007 02:56 GMT
> I'm developing a simple web service using Apache, Tomcat 5, Axis 1.4
>
[quoted text clipped - 14 lines]
> What is the simplest way to setup logging in Axis? Am I on the right
> track or should I use configuration files or so?
It actually works for me with Tomcat 5.5 + Axis 1.4 !
import java.util.logging.*;
public class Dummy {
static {
Logger logger = Logger.getLogger("Dummy");
logger.addHandler(new ConsoleHandler());
logger.setLevel(Level.FINEST);
}
public void dummy() {
System.out.println("println OK");
Logger logger = Logger.getLogger("Dummy");
logger.info("java util logging OK");
}
}
console output:
println OK
2007-03-18 20:55:35 Dummy dummy
INFO: java util logging OK
2007-03-18 20:55:35 Dummy dummy
INFO: java util logging OK
(the log4j output is double because there already were a console
handler before I added a second)
Arne
cyberco - 19 Mar 2007 08:54 GMT
Hmm...OK.
I expect the output to appear in Tomcat's 'catalina.out' logging file,
is that where you see your output?
Arne Vajhøj - 20 Mar 2007 01:07 GMT
> Hmm...OK.
> I expect the output to appear in Tomcat's 'catalina.out' logging file,
> is that where you see your output?
The way I run Tomcat I have a real console windows where I see it.
Arne
Mark Jeffcoat - 20 Mar 2007 18:15 GMT
>> Hmm...OK.
>> I expect the output to appear in Tomcat's 'catalina.out' logging file,
>> is that where you see your output?
>
> The way I run Tomcat I have a real console windows where I see it.
Those should be the same; catalina.sh will redirect
stdout and stderr to catalina.out if (and only if) you
ask it to start Tomcat as a background process.

Signature
Mark Jeffcoat
Austin, TX