Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 20611 invoked from network); 28 May 2007 19:29:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 May 2007 19:29:00 -0000 Received: (qmail 7214 invoked by uid 500); 28 May 2007 19:28:55 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 7188 invoked by uid 500); 28 May 2007 19:28:55 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 7175 invoked by uid 99); 28 May 2007 19:28:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2007 12:28:54 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of robertlazarski@gmail.com designates 209.85.132.246 as permitted sender) Received: from [209.85.132.246] (HELO an-out-0708.google.com) (209.85.132.246) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2007 12:28:49 -0700 Received: by an-out-0708.google.com with SMTP id c17so467912anc for ; Mon, 28 May 2007 12:28:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=J/e+yWPW6tLkl2YNgJPRbK9XenfoGUZM6qBgCxMXHTS3niC2qcrnh5g8+clhhMlK6lkLkV8bA//DldCEtF5JDuzJ6TAbKmVLfxBjp5agrFI90h2o6h+7AvwpUiXE4YuPv7xD9ZiCGW50X4vnq+xGSAa0q1GBp3q6j3dDwolaDf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=s6FQ8FCxCtH3dHxVitDxlJlbuH23wjpG8TCPA8jr7qi71pKJagu+/HaExDTc3Uot1kuEjgEb205fck3qnQl7wXZPOewfPRcUvcQMl4MHtp+7GWko2f4ZLKnNOfuSRuINK/g53yXAt2jfgfihnhyeJgpnWOLMRVsNqebupScZNRM= Received: by 10.100.124.5 with SMTP id w5mr4712899anc.1180380143773; Mon, 28 May 2007 12:22:23 -0700 (PDT) Received: by 10.100.32.19 with HTTP; Mon, 28 May 2007 12:22:23 -0700 (PDT) Message-ID: Date: Mon, 28 May 2007 16:22:23 -0300 From: "robert lazarski" To: axis-user@ws.apache.org Subject: Re: [axis2]Configuring logging inside Tomcat In-Reply-To: <465B2787.2080409@broad.mit.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_91600_4824367.1180380143645" References: <465B2787.2080409@broad.mit.edu> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_91600_4824367.1180380143645 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline You don't need and edit the tomcat logging files to do that. One way to get what you seem to be after is: 1) Place a recent version of log4j under axis2/WEB-INF/lib 2) Define your apenders and categories in axis2/WEB-INF/classes/log4j.properties : log4j.appender.apacheOrg=org.apache.log4j.RollingFileAppender log4j.appender.apacheOrg.layout=org.apache.log4j.PatternLayout log4j.appender.apacheOrg.layout.ConversionPattern=%d [%c] - %m%n log4j.appender.apacheOrg.File=${catalina.home}/logs/apache_logs.log log4j.appender.apacheOrg.MaxFileSize=40000KB log4j.appender.apacheOrg.MaxBackupIndex=1 log4j.category.org.apache=DEBUG, apacheOrg log4j.category.com.myapp=DEBUG, apacheOrg HTH, Robert On 5/28/07, jnedzel wrote: > > Folks: > > I've been trying to do logging from inside my POJO axis2 web service, > but I'm buffaloed by the configuration. > > I'm deploying into Tomcat 5.5.x > > Currently, my error messages go to the console. I'm trying to configure > the logging so that my log messages go to a separate application log > file (which will live inside /logs. > > I've edited the Tomcat 5.x logging.properties file as follows: > > 1) I've added a handler in the handlers line: > > handlers = 1catalina.org.apache.juli.FileHandler, > ....6genecruiser.org.apache.juli.FileHandler... > > 2) I've defined the handler: > > 6genecruiser.org.apache.juli.FileHandler.level = FINE > 6genecruiser.org.apache.juli.FileHandler.directory = ${catalina.base}/logs > 6genecruiser.org.apache.juli.FileHandler.prefix = genecruiser. > > 3) I've assigned the handler to the context: > > org.apache.catalina.core.ContainerBase > .[Catalina].[localhost].[/axis2].level > = DEBUG > org.apache.catalina.core.ContainerBase > .[Catalina].[localhost].[/axis2].handlers > = 6genecruiser.org.apache.juli.FileHandler > > Inside my axis2 web service, I get the log as follows: > > private static Log log = LogFactory.getLog(VariationService.class); > > I then log a message using: > > log.error("hello world"); > > The error message goes to the Tomcat console. My genecruiser.log file > gets created in the /logs directory, but it is empty. > > Any suggestions? > > > > -- > Jared Nedzel > Cancer Genomics Informatics > Broad Institute > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-user-help@ws.apache.org > > ------=_Part_91600_4824367.1180380143645 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline You don't need and edit the tomcat logging files to do that. One way to get what you seem to be after is:

1) Place a recent version of log4j under axis2/WEB-INF/lib

2) Define your apenders and categories in axis2/WEB-INF/classes/log4j.properties :

log4j.appender.apacheOrg=org.apache.log4j.RollingFileAppender
log4j.appender.apacheOrg.layout=org.apache.log4j.PatternLayout
log4j.appender.apacheOrg.layout.ConversionPattern=%d [%c] - %m%n

log4j.appender.apacheOrg.File=${catalina.home}/logs/apache_logs.log

log4j.appender.apacheOrg.MaxFileSize=40000KB
log4j.appender.apacheOrg.MaxBackupIndex=1

log4j.category.org.apache=DEBUG, apacheOrg
log4j.category.com.myapp=DEBUG, apacheOrg

HTH,
Robert

On 5/28/07, jnedzel <jnedzel@broad.mit.edu> wrote:
Folks:

I've been trying to do logging from inside my POJO axis2 web service,
but I'm buffaloed by the configuration.

I'm deploying into Tomcat 5.5.x

Currently, my error messages go to the console.  I'm trying to configure
the logging so that my log messages go to a separate application log
file (which will live inside <CATALINA_HOME>/logs.

I've edited the Tomcat 5.x logging.properties file as follows:

1) I've added a handler in the handlers line:

handlers = 1catalina.org.apache.juli.FileHandler,
....6genecruiser.org.apache.juli.FileHandler...

2) I've defined the handler:

6genecruiser.org.apache.juli.FileHandler.level = FINE
6genecruiser.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
6genecruiser.org.apache.juli.FileHandler.prefix = genecruiser.

3) I've assigned the handler to the context:

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/axis2].level
= DEBUG
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/axis2].handlers
= 6genecruiser.org.apache.juli.FileHandler

Inside my axis2 web service, I get the log as follows:

   private static Log log = LogFactory.getLog(VariationService.class);

I then log a message using:

   log.error("hello world");

The error message goes to the Tomcat console.  My genecruiser.log file
gets created in the <CATALINA_HOME>/logs directory, but it is empty.

Any suggestions?



--
Jared Nedzel
Cancer Genomics Informatics
Broad Institute

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


------=_Part_91600_4824367.1180380143645--