tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: Still trying to log using org.apache.juli.FileHandler ...
Date Sat, 08 Dec 2007 21:11:50 GMT
Albrecht et al

here are my logging options form %CATALINA_HOME%/bin/catalina.bat:
set
JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoade
rLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.pr
operties"

Here are my %CATALINA_HOME%/conf/logging.properties
handlers = 1catalina.org.apache.juli.FileHandler,
2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler,
5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

handlers = 1catalina.org.apache.juli.FileHandler,
java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

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

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

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

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

5host-manager.org.apache.juli.FileHandler.level = FINE
5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].lev
el = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].han
dlers = 3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level
= INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handl
ers = 4admin.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager
].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager
].handlers = 5host-manager.org.apache.juli.FileHandler

and in %TOMCAT_HOME%/conf/server.xml
AccessLogValve is commented out

%TOMCAT_HOME%/lib/log4j.properties contents:
log4j.rootLogger=INFO, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

I have no output/extras/tomcat-juli.jar. the only tomcat-juli.jar I have is
located in %CATALINA_HOME%/bin  and is 17508 in size

I have no tomcat-juli-adapters.jar in any of my tc distros

%CATALINA_HOME%/lib/log4j.jar v 1.2.14
%CATALINA_HOME%/lib/commons-logging.jar v. 1.0.4

%JAVA_HOME%/jre/lib/logging.properties
############################################################
#   Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################

############################################################
#   Global properties
############################################################

# "handlers" specifies a comma separated list of log Handler
# classes.  These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers= java.util.logging.ConsoleHandler

# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers.  For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
level= INFO

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
com.xyz.foo.level = SEVERE

and this is what I see
Handler error
java.lang.IllegalArgumentException: Bad level "DEBUG"
        at java.util.logging.Level.parse(Level.java:336)

Any idea what this is?
M-


----- Original Message -----
From: "Albretch Mueller" <lbrtchx@gmail.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Saturday, December 08, 2007 11:32 AM
Subject: Re: Still trying to log using org.apache.juli.FileHandler ...


> Thanks for your help Chuck and I have started to suspect the
> documentation a bit or something weird may be happening
> ~
> > Did you miss this part of the doc?
> ~
> "You would place a similar log4j.properties file in your web
> application's WEB-INF/classes folder, and log4j1.2.8.jar into
> WEB-INF/lib. Then specify your package level logging. This is a basic
> setup of log4j which does *not* require Commons-Logging"
> ~
>  Yes, I had done that even though I forgot to mention it
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~
>  Granted, even though I have done quite a bit of servlets coding using
> tomcat (pre. 4.1X) for production environments, I stopped coding
> servlets for some time already, but I don't think I would qualify as a
> noob
> ~
>  I have even dropped this conf issue for a while to give a fresh view
> and even carefully read both
> ~
>  http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> ~
>  http://tomcat.apache.org/tomcat-5.5-doc/logging.html
> ~
>  to see if there were something missing in the tomcat-6.0 logging
> documentation and I did notice differences in the docs:
> ~
>  1._ TC_5.5.X wants you to download and place Log4J (v1.2 or later)
> jar in $CATALINA_HOME/common/lib NOT $CATALINA_HOME/lib as is the case
> with TC_6.
> ~
>  2._ TC_5.5.X wants you to download and place the commons-logging.jar
> (not commons-logging-api.jar) in $CATALINA_HOME/common/lib with the
> log4j jar. For TC_6 you should build extras.xml ant build from TC
> source and replace $CATALINA_HOME/bin/tomcat-juli.jar with
> output/extras/tomcat-juli.jar, as well as place
> output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
> ~
>  which I did
> ~
> root@Knoppix:/media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/bin# ls -l
> tomcat-juli*.*
> -rwxrwxrwx 1 knoppix knoppix 43522 Dec  7 18:10 tomcat-juli.jar
> -rwxrwxrwx 1 knoppix knoppix 17508 Jul 19 23:20 tomcat-juli.old.jar~
> root@Knoppix:/media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/bin# md5sum
> tomcat-juli*.*
> a3cf056cefe384c33f65a73c18277b85  tomcat-juli.jar
> 026e9dd179d54dd826fa0ecd485a60fc  tomcat-juli.old.jar~
> ~
> root@Knoppix:/media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib# md5sum
> tomcat-juli*.*
> 881f04ebfe539cb9a17499a00ea37700  tomcat-juli-adapters.jar
> ~
> // __ I did include log4j-1.2.8.jar in the webapp's /WEB-INF/lib
> directory and went as far as using the same log4j-1.2.8.jar in
> {$catalina.home}/conf
> ~
> root@Knoppix:~# ls -l
/media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j*.*
> -rwxrwxrwx 1 knoppix knoppix 358085 Dec  7 18:10
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j-1.2.12.jar~
> -rwxrwxrwx 1 knoppix knoppix 352668 Feb 20  2003
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j-1.2.8.jar
> -rwxrwxrwx 1 knoppix knoppix    546 Dec  8 06:32
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j.properties
> root@Knoppix:~# md5sum
/media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j*.*
> 223504f742addd3f631ed8bdf689f1c9
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j-1.2.12.jar~
> 18a4ca847248e5b8606325684342701c
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j-1.2.8.jar
> 046c0cdd041de8ad4e8c4335e4d33eab
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j.properties
> ~
> root@Knoppix:~# ls -l
> /media/sdc5/tc-6.0.14/webapps02/fileupload/WEB-INF/lib/log4j*.*
> -rwxrwxrwx 1 knoppix knoppix 352668 Feb 20  2003
> /media/sdc5/tc-6.0.14/webapps02/fileupload/WEB-INF/lib/log4j-1.2.8.jar
> root@Knoppix:~# md5sum
> /media/sdc5/tc-6.0.14/webapps02/fileupload/WEB-INF/lib/log4j*.*
> 18a4ca847248e5b8606325684342701c
> /media/sdc5/tc-6.0.14/webapps02/fileupload/WEB-INF/lib/log4j-1.2.8.jar
> ~
> // __ Here is my {$catalina.home}/lib/log4j.properties
> ~
> root@Knoppix:~# cat
> /media/sdc5/tc-6.0.14/apache-tomcat-6.0.14/lib/log4j.properties
> log4j.rootLogger=debug, R
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=/media/sdc5/tc-6.0.14/logs/tomcat.log
> log4j.appender.R.MaxFileSize=10MB
> log4j.appender.R.MaxBackupIndex=10
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> log4j.logger.org.apache.catalina=DEBUG, R
>
>
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=D
EBUG,
> R
> log4j.logger.org.apache.catalina.core=DEBUG, R
> log4j.logger.org.apache.catalina.session=DEBUG, R
> ~
> // __ and my web apps logging conf
> ~
> root@Knoppix:~# cat
>
/media/sdc5/tc-6.0.14/webapps02/fileupload/WEB-INF/classes/log4j.properties
> log4j.rootLogger=debug, UpFl
> log4j.appender.UpFl=org.apache.log4j.RollingFileAppender
>
log4j.appender.UpFl.File=/media/sdc5/tc-6.0.14/logs/tc-6.0.14_fileupload.log
> log4j.appender.UpFl.MaxFileSize=10MB
> log4j.appender.UpFl.MaxBackupIndex=10
> log4j.appender.UpFl.layout=org.apache.log4j.PatternLayout
> log4j.appender.UpFl.layout.ConversionPattern=%p %t %c - %m%n
> log4j.logger.org.apache.catalina=DEBUG, UpFl
>
>
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=D
EBUG,
> UpFl
> log4j.logger.org.apache.catalina.core=DEBUG, UpFl
> log4j.logger.org.apache.catalina.session=DEBUG, UpFl
>
> ~
> // __ I also declared swallowOutput="true" in my
> /media/sdc5/tc-6.0.14/webapps02/fileupload/META-INF/context.xml file:
> ~
> <Context path="/fileupload"
> docBase="/media/sdc5/tc-6.0.14/webapps02/fileupload"
> reloadable="true"
> crossContext="true"
>         swallowOutput="true">
> </Context>
> ~
> // __  I don't think it relates to the OS but here is what my system
> is based on:
> ~
> root@Knoppix:~# uname -a
> Linux Knoppix 2.6.19 #7 SMP PREEMPT Sun Dec 17 22:01:07 CET 2006 i686
GNU/Linux
> ~
> root@Knoppix:~# JAVA_HOME=/media/sdc2/inst/JAVA/jdk1.6.0_03
> root@Knoppix:~# export JAVA_HOME
> root@Knoppix:~# java -version
> java version "1.6.0_03"
> Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
> Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
> ~
> /dev/sdc2 on /media/sdc2 type reiserfs (rw,nosuid,nodev)
> /dev/sdc5 on /media/sdc5 type vfat
> (rw,nosuid,nodev,umask=000,shortname=winnt,uid=1000,gid=1000)
> ~
>  Logging from /lib/log4j.properties in
> /media/sdc5/tc-6.0.14/logs/tomcat.log is working fine but not for the
> webapp. No file is created in the defined logs directory
> System.out.println("...") is not working either and I can not see any
> errors in /media/sdc5/tc-6.0.14/logs/tc-6.0.14_fileupload.log
> ~
>  How can I fix this annoying problem?
> ~
>  Thank you
>  lbrtchx
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message