Discussion:
Tomcat 7.0 logging on different platforms
Tomcat Random
2013-08-22 15:44:23 UTC
Permalink
My development setup is Win7 while my production is RHEL6. Both of the
environments have the same settings in conf/logging.properties but the
files in logs/ are slightly different.

The access logs are named the same way. but on RHEL there's no
tomcat7-stdout or tomcat7-stderr log files. Just 'catalina.out.YEAR.MO.DY'
and the cumulative "catalina.out" with no date.

What accounts for the differences?

Also, how would you stop logging to the 'catalina.out' file. It gets
unusably gigantic within a few days.

Thanks,
Alec
Mark Thomas
2013-08-22 15:52:17 UTC
Permalink
Post by Tomcat Random
My development setup is Win7 while my production is RHEL6. Both of the
environments have the same settings in conf/logging.properties but the
files in logs/ are slightly different.
The access logs are named the same way. but on RHEL there's no
tomcat7-stdout or tomcat7-stderr log files. Just 'catalina.out.YEAR.MO.DY'
and the cumulative "catalina.out" with no date.
What accounts for the differences?
The Windows service wrapper vs. catalina.sh
Post by Tomcat Random
Also, how would you stop logging to the 'catalina.out' file. It gets
unusably gigantic within a few days.
Remove the console logger from logging.properties

Mark
Konstantin Kolinko
2013-08-22 15:52:48 UTC
Permalink
Post by Tomcat Random
My development setup is Win7 while my production is RHEL6. Both of the
environments have the same settings in conf/logging.properties but the
files in logs/ are slightly different.
The access logs are named the same way. but on RHEL there's no
tomcat7-stdout or tomcat7-stderr log files. Just 'catalina.out.YEAR.MO.DY'
and the cumulative "catalina.out" with no date.
What accounts for the differences?
catalina.sh redirects stderr to stdout with 2>&1 and logs them to the same file

Windows service wrapper (Apache Commons Daemon procrun) logs them to
separate files.
Post by Tomcat Random
Also, how would you stop logging to the 'catalina.out' file. It gets
unusably gigantic within a few days.
Just do not write to the console.

http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Considerations_for_productive_usage


Best regards,
Konstantin Kolinko
Tomcat Random
2013-08-23 20:08:55 UTC
Permalink
I've deleted any reference in logging.properties to the console. However
the file rm'd catalina.out file still coming back on restarts. Any ideas?
catalina,out is now also reporting "java.util.logging.ErrorManager: 4:
Unable to create [logs]"

Below is my altered logging.properties file:
__________________________________________


handlers = 1catalina.org.apache.juli.FileHandler,
2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler,
4host-manager.org.apache.juli.FileHandler

.handlers = 1catalina.org.apache.juli.FileHandler

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


############################################################
# 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].level
= INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers
= 3manager.org.apache.juli.FileHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE

# To see debug messages in TldLocationsCache, uncomment the following line:
#org.apache.jasper.compiler.TldLocationsCache.level = FINE

# For memcached session manager
de.javakaffee.web.msm.level = WARNING
Post by Tomcat Random
Post by Tomcat Random
My development setup is Win7 while my production is RHEL6. Both of the
environments have the same settings in conf/logging.properties but the
files in logs/ are slightly different.
The access logs are named the same way. but on RHEL there's no
tomcat7-stdout or tomcat7-stderr log files. Just
'catalina.out.YEAR.MO.DY'
Post by Tomcat Random
and the cumulative "catalina.out" with no date.
What accounts for the differences?
catalina.sh redirects stderr to stdout with 2>&1 and logs them to the same file
Windows service wrapper (Apache Commons Daemon procrun) logs them to
separate files.
Post by Tomcat Random
Also, how would you stop logging to the 'catalina.out' file. It gets
unusably gigantic within a few days.
Just do not write to the console.
http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Considerations_for_productive_usage
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Christopher Schultz
2013-08-28 14:38:25 UTC
Permalink
To whom it may concern,
Post by Tomcat Random
I've deleted any reference in logging.properties to the console.
However the file rm'd catalina.out file still coming back on
restarts. Any ideas? catalina,out is now also reporting
"java.util.logging.ErrorManager: 4: Unable to create [logs]"
How are you launching Tomcat?

- -chris
Tomcat Random
2013-08-28 16:21:33 UTC
Permalink
It's a service on RHEL: eg "service tomcat start" - that does call
catalina.sh so I can see where the catalina.out file is being generated.
I'll probably just comment that out, although without any console logging
in logging.properties it becomes quite light and captures System.err.print
messages without any specified logging level. Possibly useful.

The "Unable to create [logs]" problem was the
"4host-manager.org.apache.juli.FileHandler"
without any handler specific properties.

-Alec






On Wed, Aug 28, 2013 at 10:38 AM, Christopher Schultz <
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
To whom it may concern,
Post by Tomcat Random
I've deleted any reference in logging.properties to the console.
However the file rm'd catalina.out file still coming back on
restarts. Any ideas? catalina,out is now also reporting
"java.util.logging.ErrorManager: 4: Unable to create [logs]"
How are you launching Tomcat?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJSHgthAAoJEBzwKT+lPKRYjVYQAJE4tDjLN/wnJ3CgRHyV0h/s
74ngb9um1zsE98vdZupnoLN2uxtEtLvilXOkAmYV0ECAW3/jrkAkhPdcDzp+uoPy
IWsuPnQp6ADBgY1Sn/JUzOiuWxua+4kuZru9Lk6NikIPEf1lxQwEAehrRbcyW81K
4/b9ldP4W80hHQuxgHHSVL8WWJpKDAioIT9jSWOZ6S8/MQYW2Gs/AFtmNMooPHmr
zNEmm0gE3Y/5lZUmsUjYv//xCdfksmdYmEgo1iH48vNSyJDwxn/S+pxCmbf2gROp
4Lpab3nM4zLn+8FkYqukve22sOKwmOeWJ/28u0zo1DB0eEsnAjr+iUGa1Ff9X9pk
Uebc6qQz6QC2MuLf9UsFelj6oCnRAgW/EXKtqE+g1AogplCv7tPnDFQjTo+UMKsh
+UuGUJfIMlD04o7ZV+wFzVgeJdQ1FNPxniWoXnFolafUalSXKD9nSfKMwL1FCdtI
9S/DmmpHIzIm3fT8C8GZu7xGypqGfr5siIFFQeUWJR/RdZojAcEjGEzbmBT1nGwv
OcaHq8DIcR62t0dMgdceE1ZOmxYBKwWtZYeMyV6oRkCZWzxiYdk45lOE4MalBi3F
odsTFvhvEmdnCgEkw7Gu6fjYOPvm4RTLb2nvUg5uYB5Rgu2pMAB+7RxfLcg3PlUY
BoUCswXVBKfaBpDqd5KE
=d6es
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
Loading...