tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How can I access tomcat's logs using my jsp?
Date Sat, 04 Feb 2012 18:14:41 GMT
Hash: SHA1


On 2/3/12 5:47 PM, André Warnier wrote:
> Caldarale, Charles R wrote:
>>> From: André Warnier [] Subject: Re: How can
>>> I access tomcat's logs using my jsp?
>>> - you can create a webapp named "tomcat-logs" (or whatever),
>>> just by creating a new directory "tomcat-logs" (or whatever)
>>> under webapps.
>> Nope.
> Here I beg to differ. The statement above was entirely accurate. 
> This application won't do anything, and even less what the OP
> wanted, but it will exist, and Tomcat will dispatch to it.

Yes, but it won't serve the files you want. It will most likely serve
an empty directory (or it should). Tomcat will ignore the docBase (or
it should).

You might be able to use a VirtualWebappLoader with the virtual class
path set to ${catalina.base}/logs, but I'm not sure if the
DefaultServlet will be able to use that. I've never tried it.

Or, you could just write some code to read and dump the file(s)
yourself. I would probably have specific log file names that are
recognized and served rather than allowing the remote user to just
specify a filename and let them poke-around looking for whatever files
your webapp is willing to serve. Just ask for ../conf/server.xml and
we've got a problem unless you're very careful about sanitizing inputs.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message