Axis logging: howto setup?

C

cyberco

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
 
C

cyberco

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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

cyberco said:
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?

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
 
C

cyberco

Hmm...OK.
I expect the output to appear in Tomcat's 'catalina.out' logging file,
is that where you see your output?
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

cyberco said:
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
 
M

Mark Jeffcoat

Arne Vajhøj said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top