It's not a secret anymore!
The moose likes Servlets and the fly likes Where is logging file stored? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Where is logging file stored?" Watch "Where is logging file stored?" New topic

Where is logging file stored?

William Asher

Joined: Jul 23, 2009
Posts: 25
I know there are no stupid questions, but this one feels stupid. I am trying to use the commons-logging API in a servlet, and can't figure out where the log is written.

Here is part of my code

Although I don't think this was really necessary, I created a file with a single keyword in it:

And I created a with a single keyword in it:

I have tried varying the "/" characters to "\" since I am running Tomcat 6.0 on my Windows XP system. I have looked for the log in d:\temp\mylog.log, and also in the C:\Program Files\Apache Software Foundation\Tomcat 6.0\logs folder. I can't find the log!

My program compiles with no problem and the servlet runs and displays results (it updates and displays data from a MySQL database; the code for that part is not shown above).

Any ideas as to where that pesky log is (or what it is called by default, in the absence of my attempt at overriding the default) would be appreciated.
parampreet sethi

Joined: Aug 03, 2009
Posts: 27

Where have you copied the file? Normally it's available inside webapps/App/WEB-INF/classes folder.

The another thing you can try is removing the full path from

and keep it as

This should by default create the log file inside the Tomcat logs folder.

William Asher

Joined: Jul 23, 2009
Posts: 25
Thanks for your suggestion, but unfortunately I haven't had success finding the log file yet.

I had the two properties files ( and in the WEB-INF folder. I moved them as you suggested to a newly created classes folder under WEB-INF but got the same result - successful servlet execution with no exceptions, but I cannot find the log data anywhere.

I also tried removing the absolute path from the property value in, and got the same result.

Initially I tried all this without using any property files, under the assumption that the system would place the log in a default location (the Tomcat logs folder). Tomcat creates four logs in that folder (host-manager.yyyy-mm-dd.log, manager.yyyy-mm-dd.log, localhost.yyyy-mm-dd.log, and catalina.yyyy-mm-dd.log), but none of these logs contain my output. Is there a default location (and physical file name) where the log gets written?

Of course I scoured the commons-logging documentation before I posted, but I could not find any reference to a physical file where the logging data would be stored. Which is why I posted the question. Certainly somebody has used this logging facility and has then actually opened the log in a text editor to see what it contains.

Thanks in advance for any further help!

William Asher
I agree. Here's the link:
subject: Where is logging file stored?
It's not a secret anymore!