You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohit Anchlia <mo...@gmail.com> on 2009/02/13 19:13:33 UTC
catalina.out
Is there a way to just log SEVERE or ERROR messages to catalina.out?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina.out
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mohit,
On 2/15/2009 11:57 AM, Mohit Anchlia wrote:
> Thanks. There doesn't seem to be mention of catalina.out. Only one
> line that it has referes to other catalina.<date> file that tomcat
> creates
>
> 1catalina.org.apache.juli.FileHandler.prefix = catalina.
That's a different log file (something like catalina.2009-02-16.log).
Tomcat redirects standard output and standard error in catalina.sh to
catalina.out to capture any output that goes to stdout/stderr.
The configuration for this is in logging.properties, here:
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter
The "ConsoleHandler" writes log messages to the "console" (aka stdout).
This is what ends up in catalina.out.
Chuck's suggestion that Tomcat "does not write to stdout" is not
entirely true. Tomcat's code definitely contains portions which write
directly to System.out. Mostly, these are special situations (startup
errors, etc.). On the other hand, Tomcat makes heavy use of logging, and
comes pre-configured to write some of those logs to the console, which
is the same thing as System.out or stdout.
I hope that clears up some of the confusion.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEUEARECAAYFAkmZ3GMACgkQ9CaO5/Lv0PDVcQCVHwdTbuB9zZpphS8M3ZbExSXw
sgCfePsAG5Mw4ZcfdsqjcRLITZoEn7M=
=2ysD
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina.out
Posted by Anurag Kapur <an...@gmail.com>.
Mohit,
>From the Tomcat documentation (
http://tomcat.apache.org/tomcat-5.5-doc/logging.html):-
The logging.properties shipped with JDK is set to INFO. This file can be
located at $JAVA_HOME/jre/lib
Thus your default logging level in catalina.out is set to INFO.
In order to override this, either configure Log4j or java.util.logging in
your Tomcat container.
Example, if you choose to configure Log4j, you have to:-
1. Create a file called log4j.properties as per your needs and save it into
common/classes. Obviously in your case you would set the Root Logger to
ERROR and specific packages as per your needs to lower logging levels.
The example mentioned in the documentation refers to a file named
tomcat.log. If you use the example as is, you would stop getting any logging
messages in catalina.out, and start getting the same messages if tomcat.log
instead. If you are keen to use catalina.out use the following line:
log4j.appender.R.File=${catalina.home}/logs/catalina.out
instead of
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
2. Download Log4J <http://logging.apache.org/log4j> (v1.2 or later) and
place the log4j jar in $CATALINA_HOME/common/lib.
3. Download Commons
Logging<http://commons.apache.org/downloads/download_logging.cgi> and
place the commons-logging-x.y.z.jar (not commons-logging-api-x.y.z.jar) in
$CATALINA_HOME/common/lib with the log4j jar.
4. Start Tomcat
Corresponding steps are available if you want to use java.util.logging
instead of Log4j.
I have used the above configurations and they do work as expected!
All the best!
Cheers
Anurag
------------------------------------------------------------------
Anurag Kapur
Associate - Technology,
Sapient Corporation India.
http://www.linkedin.com/in/anuragkapur
------------------------------------------------------------------
On Sun, Feb 15, 2009 at 4:57 PM, Mohit Anchlia <mo...@gmail.com>wrote:
> Thanks. There doesn't seem to be mention of catalina.out. Only one
> line that it has referes to other catalina.<date> file that tomcat
> creates
>
> 1catalina.org.apache.juli.FileHandler.prefix = catalina.
>
>
>
> On Sun, Feb 15, 2009 at 6:54 AM, Christopher Schultz
> <ch...@christopherschultz.net> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Mohit,
> >
> > On 2/13/2009 1:13 PM, Mohit Anchlia wrote:
> >> Is there a way to just log SEVERE or ERROR messages to catalina.out?
> >
> > Yes.
> >
> > http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> >
> > Skip the log4j-specific parts unless you are using log4j.
> >
> > You really need to see what documentation already exists before you ask
> > these questions.
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> >
> > iEYEARECAAYFAkmYLLQACgkQ9CaO5/Lv0PBPFACeOhQy3oIkKcYenedw16/Ux+EH
> > lFMAnRjg/YUzYAK62CLsoT5+ziAhjrlr
> > =TGhI
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: catalina.out
Posted by André Warnier <aw...@ice-sa.com>.
Caldarale, Charles R wrote:
>> From: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
>> Subject: Re: catalina.out
>>
>> There doesn't seem to be mention of catalina.out.
>
> Tomcat does not use catalina.out directly. There are redirects in the Linux version of the Tomcat startup scripts that send System.out and System.err to catalina.out. Tomcat itself does not write to System.out or System.err, and no self-respecting webapp should either.
>
Now if you don't care about self-respect for either yourself or your
webapp, it sure is a lot easier and quicker than understanding the Juli
or (worse) the log4j documentation, and applying it to Tomcat.
In addition, your sysadmin will love you, because you're writing
somewhere where he can find it.
;-)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: catalina.out
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
> Subject: Re: catalina.out
>
> There doesn't seem to be mention of catalina.out.
Tomcat does not use catalina.out directly. There are redirects in the Linux version of the Tomcat startup scripts that send System.out and System.err to catalina.out. Tomcat itself does not write to System.out or System.err, and no self-respecting webapp should either.
- 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina.out
Posted by Mohit Anchlia <mo...@gmail.com>.
Thanks. There doesn't seem to be mention of catalina.out. Only one
line that it has referes to other catalina.<date> file that tomcat
creates
1catalina.org.apache.juli.FileHandler.prefix = catalina.
On Sun, Feb 15, 2009 at 6:54 AM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mohit,
>
> On 2/13/2009 1:13 PM, Mohit Anchlia wrote:
>> Is there a way to just log SEVERE or ERROR messages to catalina.out?
>
> Yes.
>
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
>
> Skip the log4j-specific parts unless you are using log4j.
>
> You really need to see what documentation already exists before you ask
> these questions.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkmYLLQACgkQ9CaO5/Lv0PBPFACeOhQy3oIkKcYenedw16/Ux+EH
> lFMAnRjg/YUzYAK62CLsoT5+ziAhjrlr
> =TGhI
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina.out
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mohit,
On 2/13/2009 1:13 PM, Mohit Anchlia wrote:
> Is there a way to just log SEVERE or ERROR messages to catalina.out?
Yes.
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
Skip the log4j-specific parts unless you are using log4j.
You really need to see what documentation already exists before you ask
these questions.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmYLLQACgkQ9CaO5/Lv0PBPFACeOhQy3oIkKcYenedw16/Ux+EH
lFMAnRjg/YUzYAK62CLsoT5+ziAhjrlr
=TGhI
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org