Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Axis logging: howto setup?

Thread view: 
cyberco - 13 Mar 2007 19:17 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.