RE: Tomcat 5.5.4 and log4j problem

2005-01-18 Thread Allistair Crossley
Hi,

We had this and it went away by using log4j 1.2.9 or 1.3 beta/alpha.

log4j.appender.ErrorsA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ErrorsA.File=d:/jakarta-tomcat/logs/iq-Sys-Error.log
log4j.appender.ErrorsA.layout=org.apache.log4j.PatternLayout
log4j.appender.ErrorsA.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n
log4j.appender.ErrorsA.DatePattern=.-MM-dd

Allistair.

 -Original Message-
 From: Yuval Zantkeren [mailto:[EMAIL PROTECTED]
 Sent: 17 January 2005 20:51
 To: tomcat-user@jakarta.apache.org
 Subject: Tomcat 5.5.4 and log4j problem


 Hi,

 We try to use log4j with Tomcat 5.5.4 on Windows 2003 server
 and we have problems with the rename of the files on rollover.
 We try to use DailyRollingFileAppender  and also
 RollingFileAppender  but both with no luck.
 Every time the files need to roll we get Log4j:ERROR Failed
 to rename and the files name.

 It is very important to us because it logs all of our
 operation and transaction in our website.

 I will appreciate any kind of help,

 Regards,

 Yuval
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Developers of QuickAddress Software
a href=http://www.qas.com;www.qas.com/a
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.5.4 and log4j problem

2005-01-18 Thread Yuval Zantkeren
Hi,

We use log4j 1.2.9 but we still have the problem.
It was only the jar?

Regards,

Yuval

-Original Message-
From: Allistair Crossley [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 18, 2005 11:29 AM
To: Tomcat Users List
Subject: RE: Tomcat 5.5.4 and log4j problem

Hi,

We had this and it went away by using log4j 1.2.9 or 1.3 beta/alpha.

log4j.appender.ErrorsA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ErrorsA.File=d:/jakarta-tomcat/logs/iq-Sys-Error.log
log4j.appender.ErrorsA.layout=org.apache.log4j.PatternLayout
log4j.appender.ErrorsA.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n
log4j.appender.ErrorsA.DatePattern=.-MM-dd

Allistair.

 -Original Message-
 From: Yuval Zantkeren [mailto:[EMAIL PROTECTED]
 Sent: 17 January 2005 20:51
 To: tomcat-user@jakarta.apache.org
 Subject: Tomcat 5.5.4 and log4j problem


 Hi,

 We try to use log4j with Tomcat 5.5.4 on Windows 2003 server
 and we have problems with the rename of the files on rollover.
 We try to use DailyRollingFileAppender  and also
 RollingFileAppender  but both with no luck.
 Every time the files need to roll we get Log4j:ERROR Failed
 to rename and the files name.

 It is very important to us because it logs all of our
 operation and transaction in our website.

 I will appreciate any kind of help,

 Regards,

 Yuval
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
Developers of QuickAddress Software
a href=http://www.qas.com;www.qas.com/a
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 5.5.4 and log4j problem

2005-01-17 Thread Yuval Zantkeren
Hi,

We try to use log4j with Tomcat 5.5.4 on Windows 2003 server and we have 
problems with the rename of the files on rollover.
We try to use DailyRollingFileAppender  and also RollingFileAppender  but both 
with no luck.
Every time the files need to roll we get Log4j:ERROR Failed to rename and the 
files name.

It is very important to us because it logs all of our operation and transaction 
in our website.

I will appreciate any kind of help,

Regards,

Yuval

Tomcat 5.5.4 and Log4j

2004-11-24 Thread Wouter De Vaal
Hi,

I'm having difficulties to configure log4j with tomcat logging per context.
Here's what I have done:
1. I've added log4j.jar to the bin dir
2. I've created a log4j.xml in common/classes and added the log4j.dtd
This seems to work, because when I add a debug logger for org.apache,
I get a lot of extra logging lines in stdout.log.
But now I have a new webapp called advertisements and this is de
message that I get in de stdout.log:
log4j:WARN No appenders could be found for logger
(org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]).
log4j:WARN Please initialize the log4j system properly.

But when I add the logger with this name I get the following error:
log4j:ERROR Parsing error on line 10 and column 100
log4j:ERROR Attribute value
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]
of type ID must be a name.

So I guess log4j can't handle these names?

I've also tried to use a log4j.properties (which also works when I add
a debug logger for org.apache), but that doesn't work either, but this
time I only get the first warning.

My log4j.xml:
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE log4j:configuration SYSTEM log4j.dtd
log4j:configuration
   !-- STDOUT: Outputs log information to the standard output/console --
   appender name=STDOUT class=org.apache.log4j.ConsoleAppender
   layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern value=%d %-5p - %m%n/
   /layout
   /appender
   logger 
name=org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]
   level value=DEBUG/
   appender-ref ref=STDOUT/
   /logger
   logger name=org.apache
   level value=INFO/
   appender-ref ref=STDOUT/
   /logger
   root
   level value=ERROR/
   /root
/log4j:configuration

alternative log4j.properties:
log4j.rootLogger=ERROR, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#log4j.logger.org.apache=DEBUG,A1
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]=INFO,A1

Regards,
Wouter de Vaal

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 5.5.4 and Log4j

2004-11-24 Thread Jacob Kjome

Look in the archives for another email from me.  The fact is that the logger
naming scheme used by Tomcat for its host and context logs is simply
incompatible with the DOMConfigurator.  This is because the XML files it
processes use the log4j.dtd which define the logger name attribute as an
ID.   The problem occurrs with the characters [, ], and /.  See the XML
spec (or my other email somewhere in the archives of Tomcat-user or log4j-user)
for details on legal characters for attributes of type ID.

There is hope coming in Log4j-1.3 which deprecates the DOMConfigurator in favor
of the JoranConfigurator which works with more free-form xml (not enforced by
DTD) configuration files.

However, your immediate solution is to use a log4j.properties file to configure
Tomcat-5.5.x logging.  Here's an example...


log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r - %m%n

log4j.appender.A2=org.apache.log4j.FileAppender
log4j.appender.A2.File=${catalina.home}/logs/stdout.log
log4j.appender.A2.Append=false
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r - %m%n

log4j.appender.LOCALHOST=org.apache.log4j.RollingFileAppender
log4j.appender.LOCALHOST.File=${catalina.home}/logs/localhost.log
log4j.appender.LOCALHOST.MaxFileSize=1000KB
log4j.appender.LOCALHOST.MaxBackupIndex=1
log4j.appender.LOCALHOST.layout=org.apache.log4j.PatternLayout
log4j.appender.LOCALHOST.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r -
%m%n

log4j.appender.CONTEXT1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CONTEXT1.File=${catalina.home}/logs/localhost_context1.log
log4j.appender.CONTEXT1.DatePattern='.'-MM-dd
log4j.appender.CONTEXT1.layout=org.apache.log4j.PatternLayout
log4j.appender.CONTEXT1.layout.ConversionPattern=%c{1} %-6r - %m%n

log4j.appender.CONTEXT2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CONTEXT2.File=${catalina.home}/logs/localhost_context2.log
log4j.appender.CONTEXT2.DatePattern='.'-MM-dd
log4j.appender.CONTEXT2.layout=org.apache.log4j.PatternLayout
log4j.appender.CONTEXT2.layout.ConversionPattern=%c{1} %-6r - %m%n

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/context1]=INFO,
CONTEXT1
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/context1]=false

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/conext2]=INFO,
CONTEXT2
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/context2]=false

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INHERIT,
LOCALHOST
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=false

log4j.rootLogger=INFO, A1



Jake

Quoting Wouter De Vaal [EMAIL PROTECTED]:

 Hi,

 I'm having difficulties to configure log4j with tomcat logging per context.
 Here's what I have done:
 1. I've added log4j.jar to the bin dir
 2. I've created a log4j.xml in common/classes and added the log4j.dtd
 This seems to work, because when I add a debug logger for org.apache,
 I get a lot of extra logging lines in stdout.log.
 But now I have a new webapp called advertisements and this is de
 message that I get in de stdout.log:
 log4j:WARN No appenders could be found for logger

(org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]).
 log4j:WARN Please initialize the log4j system properly.

 But when I add the logger with this name I get the following error:
 log4j:ERROR Parsing error on line 10 and column 100
 log4j:ERROR Attribute value

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]
 of type ID must be a name.

 So I guess log4j can't handle these names?

 I've also tried to use a log4j.properties (which also works when I add
 a debug logger for org.apache), but that doesn't work either, but this
 time I only get the first warning.

 My log4j.xml:
 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE log4j:configuration SYSTEM log4j.dtd
 log4j:configuration
!-- STDOUT: Outputs log information to the standard output/console --
appender name=STDOUT class=org.apache.log4j.ConsoleAppender
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d %-5p - %m%n/
/layout
/appender
logger

name=org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/advertisements]
level value=DEBUG/
appender-ref ref=STDOUT/
/logger
logger name=org.apache
level value=INFO/
appender-ref ref=STDOUT/
/logger
root
level value=ERROR/
/root
 /log4j:configuration

 alternative log4j.properties:
 log4j.rootLogger=ERROR, A1
 log4j.appender.A1=org.apache.log4j.ConsoleAppender
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout

 # Print the date in ISO 8601 format