You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Mast <jh...@gmail.com> on 2008/06/19 16:57:29 UTC

Logging contexts with multiple / in path attribute

I want to capture the System.out and System.err stuff for individual
web-apps (ie. Contexts).  I've done this ok for some of my contexts but I
have a question about how to do this for my webapps whose "path" attribute
contains more than 1 slash, eg.

<Context path="/foo/bar" ....>

Specifically, how do I reference this webapp in the logging.properties
file?  For contexts with just a single slash in their path:

<Context path="/blah" ...>

I altered the logging.properties file by adding
6blah.org.apache.juli.FileHandler
6blah.org.apache.juli.FileHandler.level = FINE
6blah.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
6blah.org.apache.juli.FileHandler.prefix = blah.
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/blah].level
= FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/blah].handlers
= 6blah.org.apache.juli.FileHandler

And it has worked fine.

But how should i reference the Context whose path is "/foo/bar" ?

would 7foo.bar.org.apache.juli.FileHandler
...
work?

Re: Logging contexts with multiple / in path attribute

Posted by Jonathan Mast <jh...@gmail.com>.
Turns out the multiple / in the context path wasn't a problem.  However, its
not capturing the System.out and System.err associated with the webapps.
An empty file is created, but the System. stuff keeps going to
Catalina.out.  And i've set the swallowOutput attribute to true, so that
functionality isn't working either.

And it's not a issue with the multiple / , I have a single / context path
which I know for certain is throwing errors.  I changed it to also log
individually but it too just generates a an empty file.

I'm using Tomcat 5.5.17 on Linux.

I've added AccessLogValves to several of my webapps and they work great, too
bad no one has developed a SystemErrorLogValve.

The java.util.logging section of
http://tomcat.apache.org/tomcat-5.5-doc/logging.html seems to indicate that
it is possible to capture the System.out stuff to separate files, but
apparently this isn't working.

The log4j section of the same page seems rather daunting, and I don't know
if that will work either.


On Fri, Jun 20, 2008 at 10:39 AM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Christopher Schultz [mailto:chris@christopherschultz.net]
> > Subject: Re: Logging contexts with multiple / in path attribute
> >
> > Does this really capture use of System.out and System.err? Cool! I
> > didn't know that!
>
> Isn't that just a result of setting swallowOutput to "true" for the
> <Context>?
>
>  - 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: Logging contexts with multiple / in path attribute

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Subject: Re: Logging contexts with multiple / in path attribute
>
> Does this really capture use of System.out and System.err? Cool! I
> didn't know that!

Isn't that just a result of setting swallowOutput to "true" for the <Context>?

 - 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: Logging contexts with multiple / in path attribute

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan,

I know you've posted before, but could you remind us of your TC version?

Jonathan Mast wrote:
| <Context path="/foo/bar" ....>
|
| Specifically, how do I reference this webapp in the logging.properties
| file?  For contexts with just a single slash in their path:
|
| <Context path="/blah" ...>

[snip]

|
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/blah].handlers
| = 6blah.org.apache.juli.FileHandler
|
| And it has worked fine.
|
| But how should i reference the Context whose path is "/foo/bar" ?

I would imagine that

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/foo/bar].handlers
= 7foobar.org.apache.juli.FileHandler

would work (including the configuration for the "7foobar..." handler.

If you are getting these messages already in a log file, they should be
including the name of the logger already (which includes the magic
incantation you'll need to use for the part before ".handlers" in your
logging.properties configuration.

Does this really capture use of System.out and System.err? Cool! I
didn't know that!

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhbvboACgkQ9CaO5/Lv0PDOqQCfbvKJQ1G8Nvbj8hxS2bgRHmLP
mC4AniV0lMb1aj+5JMhejzILwlkgKAi2
=/9nZ
-----END PGP SIGNATURE-----

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