| 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".
|
 |
 |
|
|
subject: How to define tomcat log file name?
|
|
|