Logging With Tomcat 5.5

2005-08-02 Thread Scott Purcell
Hello,

I am sure this topic has been beaten to death, but I am having trouble 
understanding how the Log4J works, and how I can configure it on my localbox.

First off, I am running Tomcat 5.5 and I have created two webapp contexts. One 
is a dev site, and the other is a production site. I am using struts (I don't 
think it matters).

I would to be able to have two sets of rolling logs. One for dev, and the other 
for production. I am trying to decipher the readme at 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html; but I am not 
truly sure if this is for all webapps, or what this is implying.

I would like to get all Tomcat messages (errors, etc) and my actual logging all 
in either one or two files per webapp.


Can someone please assist me in this? The readme just doesn't cut it, or I am 
interpreting it wrongly. Or maybe there is an example setup somewhere.

Any info would be appreciated.
Sincerely
Scott




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



RE: Logging With Tomcat 5.5

2005-08-02 Thread Allistair Crossley
Don't confuse not understanding with not sufficient. The instructions do 
lead to a correct configuration. However, here it is more explicitly.

Allistair.

Per-webapp logging
==

1. Add log4j's jar to both your webapp's WEB-INF/lib folders
2. Add log4j.properties to both your webapp's WEB-INF/classes folders. 
*Minimally*, add

log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:/jakarta-tomcat/logs/webapp-name.log
log4j.appender.R.MaxFileSize=1500KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n

to those log4j.properties files changing the File path appropriately.

Ideally you will pick up the log4j manual and create appenders that map to 
packages.

Tomcat logging with log4j
=

I've found the best way is

1. Add log4j jar to common/lib, add commons-logging.jar to common/lib
2. Add log4j.properties to common/classes with content

log4j.rootCategory=error, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:/jakarta-tomcat/logs/tomcat.log
log4j.appender.R.MaxFileSize=1500KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n

log4j.logger.org.apache.commons.modeler=INFO, R
log4j.logger.org.apache.tomcat.util.digester=ERROR, R
log4j.logger.org.apache.catalina.loader=INFO, R
log4j.logger.org.apache.catalina.session=INFO, R
log4j.logger.org.apache.catalina=DEBUG, R
log4j.logger.org.apache.commons.digester=INFO, R
log4j.logger.org.apache.commons.beanutils=INFO, R
log4j.logger.org.apache.jasper=INFO, R
log4j.additivity.org.apache.catalina=false

Tomcat logging per-webapp
=

Add to your webapp's log4j.properties files

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost][/webappname]=DEBUG,
 R 

 -Original Message-
 From: Scott Purcell [mailto:[EMAIL PROTECTED]
 Sent: 02 August 2005 14:22
 To: tomcat-user@jakarta.apache.org
 Subject: Logging With Tomcat 5.5
 
 
 Hello,
 
 I am sure this topic has been beaten to death, but I am 
 having trouble understanding how the Log4J works, and how I 
 can configure it on my localbox.
 
 First off, I am running Tomcat 5.5 and I have created two 
 webapp contexts. One is a dev site, and the other is a 
 production site. I am using struts (I don't think it matters).
 
 I would to be able to have two sets of rolling logs. One for 
 dev, and the other for production. I am trying to decipher 
 the readme at 
 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html;
  but I am not truly sure if this is for all webapps, or what 
 this is implying.
 
 I would like to get all Tomcat messages (errors, etc) and my 
 actual logging all in either one or two files per webapp.
 
 
 Can someone please assist me in this? The readme just doesn't 
 cut it, or I am interpreting it wrongly. Or maybe there is an 
 example setup somewhere.
 
 Any info would be appreciated.
 Sincerely
 Scott
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
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: Logging With Tomcat 5.5

2005-08-02 Thread Scott Purcell
Allistair,

That last instruction
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost][/webappname]=DEBUG,
 R 

What do I change the [Catalina] value to?
and that does go into the log4j.properties file under the webapp?

Thanks,
Scott







-Original Message-
From: Allistair Crossley [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 02, 2005 8:31 AM
To: Tomcat Users List
Subject: RE: Logging With Tomcat 5.5


Don't confuse not understanding with not sufficient. The instructions do 
lead to a correct configuration. However, here it is more explicitly.

Allistair.

Per-webapp logging
==

1. Add log4j's jar to both your webapp's WEB-INF/lib folders
2. Add log4j.properties to both your webapp's WEB-INF/classes folders. 
*Minimally*, add

log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:/jakarta-tomcat/logs/webapp-name.log
log4j.appender.R.MaxFileSize=1500KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n

to those log4j.properties files changing the File path appropriately.

Ideally you will pick up the log4j manual and create appenders that map to 
packages.

Tomcat logging with log4j
=

I've found the best way is

1. Add log4j jar to common/lib, add commons-logging.jar to common/lib
2. Add log4j.properties to common/classes with content

log4j.rootCategory=error, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:/jakarta-tomcat/logs/tomcat.log
log4j.appender.R.MaxFileSize=1500KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n

log4j.logger.org.apache.commons.modeler=INFO, R
log4j.logger.org.apache.tomcat.util.digester=ERROR, R
log4j.logger.org.apache.catalina.loader=INFO, R
log4j.logger.org.apache.catalina.session=INFO, R
log4j.logger.org.apache.catalina=DEBUG, R
log4j.logger.org.apache.commons.digester=INFO, R
log4j.logger.org.apache.commons.beanutils=INFO, R
log4j.logger.org.apache.jasper=INFO, R
log4j.additivity.org.apache.catalina=false

Tomcat logging per-webapp
=

Add to your webapp's log4j.properties files

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost][/webappname]=DEBUG,
 R 

 -Original Message-
 From: Scott Purcell [mailto:[EMAIL PROTECTED]
 Sent: 02 August 2005 14:22
 To: tomcat-user@jakarta.apache.org
 Subject: Logging With Tomcat 5.5
 
 
 Hello,
 
 I am sure this topic has been beaten to death, but I am 
 having trouble understanding how the Log4J works, and how I 
 can configure it on my localbox.
 
 First off, I am running Tomcat 5.5 and I have created two 
 webapp contexts. One is a dev site, and the other is a 
 production site. I am using struts (I don't think it matters).
 
 I would to be able to have two sets of rolling logs. One for 
 dev, and the other for production. I am trying to decipher 
 the readme at 
 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html;
  but I am not truly sure if this is for all webapps, or what 
 this is implying.
 
 I would like to get all Tomcat messages (errors, etc) and my 
 actual logging all in either one or two files per webapp.
 
 
 Can someone please assist me in this? The readme just doesn't 
 cut it, or I am interpreting it wrongly. Or maybe there is an 
 example setup somewhere.
 
 Any info would be appreciated.
 Sincerely
 Scott
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---
QAS Ltd.
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]



RE: Logging With Tomcat 5.5

2005-08-02 Thread Allistair Crossley
Hi,

You don't change Catalina (for most purposes). Just change end part /webappname 
to your web application name, and yes, add it into the web application's log4j. 
E.g if your webapp was called banana

You would add (in addition to the root logger etc..) into 
webapps/banana/WEB-INF/classes/log4j.properties

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost][/banana]=DEBUG,
 R

Allistair.

 -Original Message-
 From: Scott Purcell [mailto:[EMAIL PROTECTED]
 Sent: 02 August 2005 14:49
 To: Tomcat Users List
 Subject: RE: Logging With Tomcat 5.5
 
 
 Allistair,
 
 That last instruction
 log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina
 ].[localhost][/webappname]=DEBUG, R 
 
 What do I change the [Catalina] value to?
 and that does go into the log4j.properties file under the webapp?
 
 Thanks,
 Scott
 
 
 
 
 
 
 
 -Original Message-
 From: Allistair Crossley [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 02, 2005 8:31 AM
 To: Tomcat Users List
 Subject: RE: Logging With Tomcat 5.5
 
 
 Don't confuse not understanding with not sufficient. The 
 instructions do lead to a correct configuration. However, 
 here it is more explicitly.
 
 Allistair.
 
 Per-webapp logging
 ==
 
 1. Add log4j's jar to both your webapp's WEB-INF/lib folders
 2. Add log4j.properties to both your webapp's WEB-INF/classes 
 folders. *Minimally*, add
 
 log4j.rootCategory=debug, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=c:/jakarta-tomcat/logs/webapp-name.log
 log4j.appender.R.MaxFileSize=1500KB
 log4j.appender.R.MaxBackupIndex=1
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n
 
 to those log4j.properties files changing the File path appropriately.
 
 Ideally you will pick up the log4j manual and create 
 appenders that map to packages.
 
 Tomcat logging with log4j
 =
 
 I've found the best way is
 
 1. Add log4j jar to common/lib, add commons-logging.jar to common/lib
 2. Add log4j.properties to common/classes with content
 
 log4j.rootCategory=error, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=c:/jakarta-tomcat/logs/tomcat.log
 log4j.appender.R.MaxFileSize=1500KB
 log4j.appender.R.MaxBackupIndex=1
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n
 
 log4j.logger.org.apache.commons.modeler=INFO, R
 log4j.logger.org.apache.tomcat.util.digester=ERROR, R
 log4j.logger.org.apache.catalina.loader=INFO, R
 log4j.logger.org.apache.catalina.session=INFO, R
 log4j.logger.org.apache.catalina=DEBUG, R
 log4j.logger.org.apache.commons.digester=INFO, R
 log4j.logger.org.apache.commons.beanutils=INFO, R
 log4j.logger.org.apache.jasper=INFO, R
 log4j.additivity.org.apache.catalina=false
 
 Tomcat logging per-webapp
 =
 
 Add to your webapp's log4j.properties files
 
 log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina]
 .[localhost][/webappname]=DEBUG, R 
 
  -Original Message-
  From: Scott Purcell [mailto:[EMAIL PROTECTED]
  Sent: 02 August 2005 14:22
  To: tomcat-user@jakarta.apache.org
  Subject: Logging With Tomcat 5.5
  
  
  Hello,
  
  I am sure this topic has been beaten to death, but I am 
  having trouble understanding how the Log4J works, and how I 
  can configure it on my localbox.
  
  First off, I am running Tomcat 5.5 and I have created two 
  webapp contexts. One is a dev site, and the other is a 
  production site. I am using struts (I don't think it matters).
  
  I would to be able to have two sets of rolling logs. One for 
  dev, and the other for production. I am trying to decipher 
  the readme at 
  http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html;
   but I am not truly sure if this is for all webapps, or what 
  this is implying.
  
  I would like to get all Tomcat messages (errors, etc) and my 
  actual logging all in either one or two files per webapp.
  
  
  Can someone please assist me in this? The readme just doesn't 
  cut it, or I am interpreting it wrongly. Or maybe there is an 
  example setup somewhere.
  
  Any info would be appreciated.
  Sincerely
  Scott
  
  
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
 ---
 QAS Ltd.
 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

Re: Logging in Tomcat 5.5

2005-03-18 Thread Jess Holle
I'm *guessing* you're facing some of the issues I have been.
I believe you'll essentially need to set up a separate LoggerRepository 
(based on classloader, not thread or contextual class loader) and 
provide separate config files for each.

I've got log4j.jar in my WEB-INF/lib, I'm using my own 
static/classloader-based LoggerRepository, and this keeps Tomcat's logs 
using their own LoggerRepository and a separate logging configuration.  
I'm still not to where I want to be with this, but it's a far cry from 
the out-of-the-box mess that occurs with log4j and commons-logging.

--
Jess Holle
Joy Kenneth Harry wrote:
Hi,
I have a webapp in tomcat. I am using a separate Log4j.xml for it, in
its WEB-INF classes folder.
I've also put a Log4j.xml in TOMCAT_HOME/ common/classes and set it to
false so that I do not get the general Tomcat logs.
But even then my project logs are getting mixed with the TOMCAT logs.
Is there any way to disable TOMCAT logs.
 

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


How to Switch of logging in Tomcat 5.5

2005-03-17 Thread Joy Kenneth Harry



Logging in Tomcat 5.5

2005-03-17 Thread Joy Kenneth Harry
Hi,
I have a webapp in tomcat. I am using a separate Log4j.xml for it, in
its WEB-INF classes folder.

I've also put a Log4j.xml in TOMCAT_HOME/ common/classes and set it to
false so that I do not get the general Tomcat logs.

But even then my project logs are getting mixed with the TOMCAT logs.
Is there any way to disable TOMCAT logs.



Joy Kenneth




Logging in Tomcat 5.5

2005-03-17 Thread Joy Kenneth Harry

Hi,
I have a webapp in tomcat. I am using a separate Log4j.xml for it, in
its WEB-INF classes folder.

I've also put a Log4j.xml in TOMCAT_HOME/ common/classes and set it to
false so that I do not get the general Tomcat logs.

But even then my project logs are getting mixed with the TOMCAT logs.
Is there any way to disable TOMCAT logs.



Joy Kenneth





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



Re: Logging in Tomcat 5.5

2005-03-17 Thread Simon Kitching
On Fri, 2005-03-18 at 11:25 +0530, Joy Kenneth Harry wrote:
 Hi,
 I have a webapp in tomcat. I am using a separate Log4j.xml for it, in
 its WEB-INF classes folder.
 
 I've also put a Log4j.xml in TOMCAT_HOME/ common/classes and set it to
 false so that I do not get the general Tomcat logs.
 
 But even then my project logs are getting mixed with the TOMCAT logs.
 Is there any way to disable TOMCAT logs.

By project logs do you mean messages deliberately logged by the code
within *your webapp*, or do you mean messages from tomcat itself?

If you are talking about messages logged by code within your webapp, is
it using the log4j API or the commons-logging API?


Regards,

Simon


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



exception logging in tomcat 5.5

2005-02-07 Thread Christian Sell
Hello,

I just installed Tomcat 5.5.7 and ran my first webapp. I was rather disturbed
that exception information only appeared on the default error page, but nowhere
in the logs! In fact, in the out-of-the-box install, there were no logs written
at all!

I went through the docs and found a description of a rather complicated
configuration process that would supposedly bring back the normal log (it
involves copying 2 jar files and creating and copying one property file to the
tomcat/common directory).
However, since the docs say that stack trace info is written to stdout only, my
hopes are not high for success with this - I thought I would rather go ask
here. As I said, uncaught exceptions thrown from within my webapp (different
places, e.g. a servlet filter) are not written to stdout (if that is what I see
on the console). They only appear on the exception page - which is the one
place where I dont need them on the long run.

Can anyone help? Why has this been done?

thanks,
Christian

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



Re: exception logging in tomcat 5.5

2005-02-07 Thread David Smith
Standard out in tomcat is usually redirected to a file 'catalina.out' in 
the logs directory of tomcat.

--David
Christian Sell wrote:
Hello,
I just installed Tomcat 5.5.7 and ran my first webapp. I was rather disturbed
that exception information only appeared on the default error page, but nowhere
in the logs! In fact, in the out-of-the-box install, there were no logs written
at all!
I went through the docs and found a description of a rather complicated
configuration process that would supposedly bring back the normal log (it
involves copying 2 jar files and creating and copying one property file to the
tomcat/common directory).
However, since the docs say that stack trace info is written to stdout only, my
hopes are not high for success with this - I thought I would rather go ask
here. As I said, uncaught exceptions thrown from within my webapp (different
places, e.g. a servlet filter) are not written to stdout (if that is what I see
on the console). They only appear on the exception page - which is the one
place where I dont need them on the long run.
Can anyone help? Why has this been done?
thanks,
Christian
-
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]


more logging in tomcat 5.5

2004-12-04 Thread Jeff Ousley
hello!

forgive the rambling nature of this message. my basic question is how
do i get more detailed logging out of tomcat. i'm trying to set up a
JNDIRealm to authenticate to an ldap server. in my realm config i've
got the debug=99 name/value pair. my realm is included inside my
host container. i see no debug output anywhere. where should i see
this output?

i also have an accesslog valve inside the host container like this:

Valve className=org.apache.catalina.valves.AccessLogValve
  prefix=localhost_access_log. suffix=.out
  pattern=combined/


the localhost_access_log... files are being created with very minimal
information in them. is this where the debug output from the realm
should go, or in the catalina.out directory?

i've also followed the steps exactly to try and configure log4j as found here:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html

after stopping and restarting tomcat, my log4j settings seem to have
made no difference. they don't seem to be working at all. my log file
as specified in the log4j.properties file is not being created. is
there something further i must do to get this working?

is there anything i can do to get more detailed logging out of tomcat
and especially my realm config?

sorry for the mess of questions. i appreciate any help, direction, or guidance!

-jeff

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



Re: more logging in tomcat 5.5

2004-12-04 Thread Bill Barker

Jeff Ousley [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 hello!

 forgive the rambling nature of this message. my basic question is how
 do i get more detailed logging out of tomcat. i'm trying to set up a
 JNDIRealm to authenticate to an ldap server. in my realm config i've
 got the debug=99 name/value pair. my realm is included inside my
 host container. i see no debug output anywhere. where should i see
 this output?


The 'debug' attribute has been removed in 5.5, and so is simply quietly 
ignored.

 i also have an accesslog valve inside the host container like this:

Valve className=org.apache.catalina.valves.AccessLogValve
  prefix=localhost_access_log. suffix=.out
  pattern=combined/


 the localhost_access_log... files are being created with very minimal
 information in them. is this where the debug output from the realm
 should go, or in the catalina.out directory?

 i've also followed the steps exactly to try and configure log4j as found 
 here:

 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html

 after stopping and restarting tomcat, my log4j settings seem to have
 made no difference. they don't seem to be working at all. my log file
 as specified in the log4j.properties file is not being created. is
 there something further i must do to get this working?


To configure Tomcat logging via log4j, you need to download commons-logging, 
and copy commons-logging.jar (*not* commons-logging-api.jar) to 
$CATALINA_HOME/common/lib.

 is there anything i can do to get more detailed logging out of tomcat
 and especially my realm config?

 sorry for the mess of questions. i appreciate any help, direction, or 
 guidance!

 -jeff 




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