File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes How to define tomcat log file name? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "How to define tomcat log file name?" Watch "How to define tomcat log file name?" New topic
Author

How to define tomcat log file name?

jinhua jin
Greenhorn

Joined: Dec 27, 2011
Posts: 3
Dear Experts,

We have a tomcat project which runs on windows.
And we are planing to upgrade tomcat version to 7.
In our development environment, after upgrade to tomcat7,
we found the log file name was changed from
stdout_yyyymmdd.log to <productname>-stdout.yyyy-mm-dd.log.

What should we do to keep the current log file name?

Any help or advice is appriciated.

Thanks in advance.

Jinhua
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

Welcome to the JavaRanch, Jinhua!

The stdout from Tomcat is actually traditionally written to TOMCAT_HOME/logs/catalina.out. But because it is stdout, even that is only because the script that launches Tomcat has a redirection on the "java" command line.

You should be able to alter that script any way you like (as long as you understand what you are doing!)

My guess as to why the name change is that it probably makes it easier to run multiple copies of Tomcat, where each logfile's name corresponds to the name of the Tomcat that is writing it.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
jinhua jin
Greenhorn

Joined: Dec 27, 2011
Posts: 3
Thank you Tom.

I'm afraid I haven't understood what you meant.
Do you mean I can change file name using java command?
If yes, could you kindly tell me the command what I should use?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

The script that normally controls Tomcat under Windows is TOMCAT_HOME\bin\catalina.bat. Take a look at it.
jinhua jin
Greenhorn

Joined: Dec 27, 2011
Posts: 3
The application is registered as a Windows service.
And I could change the name of log file by changing the following value of in the registory.

value: StdOutput
data: auto ->%CATALINA_HOME%\logs\stdout.log

My goal is to output as stdout_yyyymmdd.log.

Setting %CATALINA_HOME%\logs\stdout_%y%d%m.log made the file's name output as "stdout_%y%d%m.log" and not "stdout_yyyymmdd.log".

 
IntelliJ Java IDE
 
subject: How to define tomcat log file name?
 
Threads others viewed
Problems with Tomcat 4.0
Log in Servlet
How to generate Big log file in tomcat?
server log disappear from console
Eclipse / MyEclipse - Logging console output ?
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture