axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robert lazarski" <robertlazar...@gmail.com>
Subject Re: [axis2]Configuring logging inside Tomcat
Date Mon, 28 May 2007 19:22:23 GMT
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
>
>

Mime
View raw message