You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Albretch Mueller <lb...@gmail.com> on 2007/12/03 21:05:54 UTC

Re: Still trying to log using org.apache.juli.FileHandler ...

~
 /META-INF directory you say? Isn't /META-INF a special descriptor
folder in WAR files?
~
 This is what I read from the latest final release of the Servlet Specification
~
// __ SRV.9.6 Web Application Archive File, page: 71
~
 SRV.9.6 Web Application Archive File
 Web applications can be packaged and signed into a Web ARchive format
(WAR) file using the standard Java archive tools. For example, an
application for issue tracking might be distributed in an archive file
called issuetrack.war.
 When packaged into such a form, a META-INF directory will be present
which contains information useful to Java archive tools. This
directory must not be directly served as content by the container in
response to a Web client's request, though its contents are visible to
servlet code via the getResource and getResourceAsStream calls on the
ServletContext. Also, any requests to access the resources in META-INF
directory must be returned with a SC_NOT_FOUND(404) response.
~
// __ SRV.9.7.1 Dependencies On Extensions, page: 72
~
 The application developer depending on such an extension or
extensions must provide a META-INF/MANIFEST.MF entry in the WAR file
listing all extensions needed by theWAR.
~
// __ SRV.S.19 PFD: Changes in this document since the Public Draft, page: 284
~
 Clarification of the status code when /META-INF/ resource is accessed
(9.6) Change xsd:string to j2ee:string in deployment descriptor (13.4)
~
 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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Martin Gainty <mg...@hotmail.com>.
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" <lb...@gmail.com>
To: "Tomcat Users List" <us...@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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Albretch Mueller <lb...@gmail.com>.
 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]=DEBUG,
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]=DEBUG,
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


RE: Still trying to log using org.apache.juli.FileHandler ...

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Albretch Mueller [mailto:lbrtchx@gmail.com] 
> Subject: Re: Still trying to log using org.apache.juli.FileHandler ...
> 
>  OK, I think, this time I did follow the FM ;-) at:

But perhaps not all of it...

>  but when I declared a log4j.properties file inside of a webapp
>  no log file is created nor do I see any log messages anywhere

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"

Note the requirement to put a separate log4j*.jar into WEB-INF/lib; I
see no mention of that in your message.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Martin Gainty <mg...@hotmail.com>.
Albretch-

try changing to anything other
than -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
and TC abends

leave logging.manager as juli ClassLoaderLogManager and these exceptions
occur
Handler error java.lang.IllegalArgumentException: Bad level "DEBUG"

even when 1catalina.org.apache.juli.FileHandler.level = FINE is defined in
%CATALINA_HOME%\conf\logging.properties
(and grep on DEBUG finds nothing in %CATALINA_HOME%)

is this a misconfig???

Vielen Danke
Martin-
----- Original Message -----
From: "Albretch Mueller" <lb...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Friday, December 07, 2007 4:33 PM
Subject: Re: Still trying to log using org.apache.juli.FileHandler ...


> I was curious as to the configuration that was being fed by the JVM
> when you go:
> ~
>  catalian run
> ~
>  that was it:
> ~
> "$JRE_HOME\bin\java" -verbose:class
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file="$CATALINA_HOME\conf\logging.properties"
> -Djava.endorsed.dirs="$CATALINA_HOME\endorsed"
> -classpath "$JRE_HOME\lib\tools.jar;$CATALINA_HOME\bin\bootstrap.jar"
> -Dcatalina.base="$CATALINA_HOME"
> -Dcatalina.home="$CATALINA_HOME"
> -Djava.io.tmpdir="$CATALINA_HOME\temp"
> org.apache.catalina.startup.Bootstrap  start
> ~
>
> ---------------------------------------------------------------------
> 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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Albretch Mueller <lb...@gmail.com>.
 I was curious as to the configuration that was being fed by the JVM
when you go:
~
 catalian run
~
 that was it:
~
"$JRE_HOME\bin\java" -verbose:class
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="$CATALINA_HOME\conf\logging.properties"
-Djava.endorsed.dirs="$CATALINA_HOME\endorsed"
-classpath "$JRE_HOME\lib\tools.jar;$CATALINA_HOME\bin\bootstrap.jar"
-Dcatalina.base="$CATALINA_HOME"
-Dcatalina.home="$CATALINA_HOME"
-Djava.io.tmpdir="$CATALINA_HOME\temp"
org.apache.catalina.startup.Bootstrap  start
~

---------------------------------------------------------------------
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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Albretch Mueller <lb...@gmail.com>.
 while searching I also notice that as John Lennon said in "imagine"
"I am not the only one" ;-)
~
 Why have they made so hard just going System.out.println(" ...") in
your servlets code?
~
 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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Albretch Mueller <lb...@gmail.com>.
 OK, I think, this time I did follow the FM ;-) at:
~
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html
~
> 1._ I did create a log4j.properties file and placed it in $CATALINA_HOME/lib
~
C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib>dir *.properties
 Volume in drive C is IBM_PRELOAD
 Volume Serial Number is 509C-397F

 Directory of C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib

12/07/2007  10:27 AM               380 log4j.properties
               1 File(s)            380 bytes
               0 Dir(s)  24,878,350,336 bytes free

C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib>type log4j.properties
log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:/cmllpz/prjx/java/GWB/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
~
> 2. v1.2 or later is in $CATALINA_HOME/lib
~
C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib>dir log4j*.jar
 Volume in drive C is IBM_PRELOAD
 Volume Serial Number is 509C-397F

 Directory of C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib

08/24/2007  11:29 PM           391,834 log4j-1.2.15.jar
               1 File(s)        391,834 bytes
               0 Dir(s)  24,878,350,336 bytes free
~
> 3. I did build extras.xml ant build script from the Tomcat source bundle, and
~
> 3.1 replaced(/renamed) $CATALINA_HOME/bin/tomcat-juli.jar with output/extras/tomcat-juli.jar
~
C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\bin>dir tomcat-juli*.*
 Volume in drive C is IBM_PRELOAD
 Volume Serial Number is 509C-397F

 Directory of C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\bin

12/07/2007  09:41 AM            43,527 tomcat-juli.jar
07/20/2007  03:20 AM            17,508 tomcat-juli.old.jar~
               2 File(s)         61,035 bytes
               0 Dir(s)  24,878,284,800 bytes free
~
> 3.2 placed output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib
~
C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib>dir tomcat-juli-adapters*.*
 Volume in drive C is IBM_PRELOAD
 Volume Serial Number is 509C-397F

 Directory of C:\cmllpz\prjx\java\GWB\tc\tc-6.0.14\lib

12/07/2007  09:41 AM            20,913 tomcat-juli-adapters.jar
               1 File(s)         20,913 bytes
               0 Dir(s)  24,878,284,800 bytes free
~
 then when I started tomcat and saw that
C:/cmllpz/prjx/java/GWB/logs/tomcat.log was created as indicated in
~
 log4j.appender.R.File=C:/cmllpz/prjx/java/GWB/logs/tomcat.log
~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~
 but when I declared a log4j.properties file inside of a webapp
~
C:\cmllpz\prjx\java\GWB\webappsDir_tc-6.0.14\webapps02\fileupload\WEB-INF\classes>dir
*.properties
 Volume in drive C is IBM_PRELOAD
 Volume Serial Number is 509C-397F

 Directory of C:\cmllpz\prjx\java\GWB\webappsDir_tc-6.0.14\webapps02\fileupload\WEB-INF\classes

12/07/2007  11:03 AM               394 log4j.properties
               1 File(s)            394 bytes
               0 Dir(s)  24,872,628,224 bytes free

~
C:\cmllpz\prjx\java\GWB\webappsDir_tc-6.0.14\webapps02\fileupload\WEB-INF\classes>type
log4j.properties
log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:/cmllpz/prjx/java/GWB/logs/tc-6.0.14_fileupload.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

~
 no log file is created nor do I see any log messages anywhere
~
 I also tentatively tried to no avail and then discarded diferent things like:
~
 * placing commons-logging-1.1.jar from the source compilation in
$CATALINA_HOME/lib, because I found a little unclear that they said
comcompile the "commons-logging" from source using ant, but they
didn't specified what to do with it
~
 * replicating <catalian source folder>/conf/logging.properties in
$CATALINA_HOME/conf/logging.properties
~
 In the book Pro Apache Tomcat 6 from Mathew Moodie he also talks
about juli-type logging.properties files while using log4j, but when I
keep $CATALINA_HOME/conf/logging.properties, I get errors like:
~
Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.util.logging.LogManager$1.run(LogManager.java:166)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.<clinit>(LogManager.java:156)
        at java.util.logging.Logger.getLogger(Logger.java:274)
        at org.apache.juli.logging.impl.Jdk14Logger.getLogger(Jdk14Logger.java:180)
        at org.apache.juli.logging.impl.Jdk14Logger.<init>(Jdk14Logger.java:60)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.juli.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
        at org.apache.juli.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
        at org.apache.juli.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
        at org.apache.juli.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
        at org.apache.juli.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
        at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:645)
        at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
~
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.util.logging.LogManager$3.run(LogManager.java:359)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.addLogger(LogManager.java:352)
        at java.util.logging.LogManager$1.run(LogManager.java:180)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.<clinit>(LogManager.java:156)
        at java.util.logging.Logger.getLogger(Logger.java:274)
        at org.apache.juli.logging.impl.Jdk14Logger.getLogger(Jdk14Logger.java:180)
        at org.apache.juli.logging.impl.Jdk14Logger.<init>(Jdk14Logger.java:60)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.juli.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
        at org.apache.juli.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
        at org.apache.juli.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
        at org.apache.juli.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
        at org.apache.juli.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
        at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:645)
        at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
~
 How could I fix these problems?
~
 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


RE: Still trying to log using org.apache.juli.FileHandler ...

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Albretch Mueller [mailto:lbrtchx@gmail.com] 
> Subject: Re: Still trying to log using org.apache.juli.FileHandler ...
> 
> <Context debug="99" reloadable="true" crossContext="true">
>  <Logger className="org.apache.catalina.logger.FileLogger"
>   directory="C:\cmllpz\prjx\java\GWB\logs"
>   prefix="tc-6.0.14-FileUpload_log."
>   suffix=".txt"
>   timestamp="true"/>
> </Context>
>
>  However I still don't see that tc is creating the log file specific
> to this webapp, namely, "tc-6.0.14-FileUpload_log"

Read The Fine Manual:
http://tomcat.apache.org/tomcat-6.0-doc/logging.html

<Logger> elements were deprecated in 5.0 and removed in 5.5 and later.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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


Re: Still trying to log using org.apache.juli.FileHandler ...

Posted by Albretch Mueller <lb...@gmail.com>.
> >  /META-INF directory you say? Isn't /META-INF a special descriptor
> > folder in WAR files?

> Yes, and also in expanded .war files.  That's where Tomcat will look for
> the context.xml file; read the doc:
> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
~
 I see! and thank you! The thing is that I has been trying to clobber
some application that I had developed during tc 4.1.36 times and after
all these changes I don't seem to see things through
~
 What I am trying to achieve is take everything that could be editted
or folders that should be writable (log files etc) to a directory out
of $CATALINA_BASE's branch
~
 Here are in the incumbered sections of server.xml and context.xml
~
~ ~ ~ $CATALINA_HOME/conf/server.xml!<Host/> ~ ~ ~
~
 <Host name="localhost"
  appBase="C:\cmllpz\prjx\java\GWB\webappsDir_tc-6.0.14\webapps02"
  unpackWARs="true"
  autoDeploy="true"
  xmlValidation="false"
  xmlNamespaceAware="false">

   <Valve className="org.apache.catalina.valves.AccessLogValve"
     directory="C:\cmllpz\prjx\java\GWB\logs"
     prefix="tc-6.0.14-localhost_access_log."
     suffix=".log"
     pattern="common"
     resolveHosts="false"/>
 </Host>
~
~ ~ ~ C:\cmllpz\prjx\java\GWB\webappsDir_tc-6.0.14\webapps02\fileupload\META-INF\context.xml
~ ~ ~
~
<Context debug="99" reloadable="true" crossContext="true">

 <Logger className="org.apache.catalina.logger.FileLogger"
  directory="C:\cmllpz\prjx\java\GWB\logs"
  prefix="tc-6.0.14-FileUpload_log."
  suffix=".txt"
  timestamp="true"/>
</Context>
~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~
 However I still don't see that tc is creating the log file specific
to this webapp, namely, "tc-6.0.14-FileUpload_log"
~
 org.apache.catalina.valves.AccessLogValve in <Host /> is worning just
fine though
~
 Thank you again
 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


RE: Still trying to log using org.apache.juli.FileHandler ...

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Albretch Mueller [mailto:lbrtchx@gmail.com] 
> Subject: Re: Still trying to log using org.apache.juli.FileHandler ...
> 
>  /META-INF directory you say? Isn't /META-INF a special descriptor
> folder in WAR files?

Yes, and also in expanded .war files.  That's where Tomcat will look for
the context.xml file; read the doc:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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