axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugh Ferguson" <hfergu...@vistar.ca>
Subject Trouble with logging in axis
Date Tue, 04 Mar 2003 22:50:55 GMT
OK,
  I tried to send this earlier but I don't think it made it through, so I'm
trying again. Please excuse the repeat if it has come through previously.  I
know that this is an old topic, but I'm at my wits end.  I just want to be
able to output some debug from within my web service class so that I can
check various things. Ultimately, I'm going to need logging for exception
handling, but at this stage, I'd settle for a simple, dumb-assed
System.out.println.

I've deployed a class that has a test service (I'm starting small). I used a
wsdd file and the admin tool. All of this is being done with Axis 1.0 and
Tomcat 4.1.12.  The class works in that when I run a test client against it,
I get the expected output. The problem is only debugging.

I borrowed from numerous examples, and use the LogFactory to get a class.
I've removed the log4j.properties file from the axis.jar and have my own
which does vary the output.  When I set my root category to DEBUG, I can see
reams of debug info, just not the debug statements I planted.

Here is the config for log 4j:
# Set root category priority to INFO and its only appender to CONSOLE.

log4j.rootCategory=INFO, CONSOLE, LOGFILE

# Set the enterprise logger category to FATAL and its only appender to
CONSOLE.
log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
# I added these but they don't make any difference.
log4j.logger.com.gwvas.soap=DEBUG, CONSOLE, LOGFILE
log4j.logger.system.out=DEBUG, CONSOLE, LOGFILE

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=axis.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Here is the class, with the call to log.info method. I've tried debug and
warn for good measure:

package com.gwvas.soap;

import java.sql.*;
file://import sqlj.runtime.*;
file://import sqlj.runtime.ref.*;
import org.apache.axis.MessageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class servicemgr {

 private static MessageContext m_msgContext;
 private static String m_strConfFile;
 private static Log m_log = LogFactory.getLog(servicemgr.class.getName());

 public static String[] termList = {"00099001VTI0001", "00099002VTI0002",
"00099003VTI0003",
          "00099004VTI0004", "00099005VTI0005", "00099006VTI0006",
          "00099007VTI0007", "00099008VTI0008", "00099009VTI0009"};

 public servicemgr() {

  if (m_msgContext == null) {
   m_msgContext = MessageContext.getCurrentContext();
   m_strConfFile = (String)m_msgContext.getProperty("confFile");
  }
 }

 public String[] getTerminals() {

  log("Conf file is " + m_strConfFile);
  log("CAN ANYONE SEE THIS???????????????????????????????????");
  System.out.println("What about this???");
  return termList;
 }

 public boolean getStatus() {
  return true;
 }

 private void log(String strMessage) {

  m_log.info(strMessage);
 }
}

Any help, suggestions would be appreciated. I feel like I've tried
everything to get even the smallest amount of debug. If this fails, I'm
simply going to have my class write to a flat file and be done with it. :(
-Hugh Ferguson



Mime
View raw message