WebSphere Quickie

by Volker Weber

How do I tell WebSphere Application Server 4.02 to create rotating logs? This is the relevant definition for stdoutFilename and stderrFilename:

<servers xmi:type="applicationserver:ApplicationServer" xmi:id="ApplicationServer_1" desiredExecutionState="START" name="Default Server" id="-1" moduleVisibility="APPLICATION"> <processDefinition xmi:type="server:JavaProcessDef" xmi:id="ProcessDef_1" executableName="${JAVA_HOME}/bin/java" commandLineArguments="" workingDirectory="${WAS_ROOT}/bin" executableTargetKind="JAVA_CLASS" executableTarget="com.ibm.ws.bootstrap.WSLauncher"> <executionSettings xmi:id="ProcessExecution_1" umask="022" runAsUser="root"/> <ioRedirect xmi:id="OutputRedirect_1" stdoutFilename="${LOG_ROOT}/default_server_stdout.log" stderrFilename="${LOG_ROOT}/default_server_stderr.log"/>

Instead of two monolithical files, I would like to start new ones every day or at least once a week.

Update: This feature was introduced in WebSphere 4.04. This is from the docs for fixpack 4.

[Thanks, Stefan]

Comments

Volker, I'm pretty sure you can't the only trick I know is that if you precede the logfile path with an exclaimation mark it then overwrtites the log everytime the application server starts.
(in the console my path = !E:\WebSphere\AppServer\logs\appname)
Not perfect I know since you lose the previous log but I've not discovered any other option yet - let me know if you find it :-)

ToadRunner, 2003-07-08

What platform is your server running on?
If it's some UNIX derivate, you might want to try an escape sequence that executes to the current date (you have to put the date command in single quotes to make it execute). Then you should get a file with the date included in the name, hence a new one each day.
Might be though, that the server evaluates the string on start up, hence only creates a file with the startup date.
Also, hopefully this is being parsed out by WebSphere, because I would consider this at least a security weakness, if not a security hole. Other code could be inserted as well and would be executed under the server's username with potentially high privileges...

But still, I'd say it's worth a try.

Ragnar Schierholz, 2003-07-08

Chris, I don't want to forget old logfiles since I need them. It's a cool trick to make sure that it does not get too big, but then I forget the file exactly when I need it, that is after a crash.

Ragnar, it is on Windows 2000. And I am not looking for experiments. I try to find somebody who knows more than I do. Which should not be too hard. :-)

Volker Weber, 2003-07-08

Recent comments

Matthias Lorz on The Neighbor’s Window :: Oscar Winning Short Film at 12:47
Volker Weber on The Neighbor’s Window :: Oscar Winning Short Film at 11:54
Fabio Peruzzi on The Neighbor’s Window :: Oscar Winning Short Film at 11:48
Fabio Peruzzi on The Neighbor’s Window :: Oscar Winning Short Film at 11:45
Horia Stanescu on The Neighbor’s Window :: Oscar Winning Short Film at 07:04
Martin Funk on The Neighbor’s Window :: Oscar Winning Short Film at 00:00
Sven Bühler on I am not ready for a foldable phone at 22:03
Andreas Imnitzer on The Neighbor’s Window :: Oscar Winning Short Film at 21:48
Roland Dressler on I am not ready for a foldable phone at 15:02
Daniel Seiler on I am not ready for a foldable phone at 13:51
Roland Dressler on I am not ready for a foldable phone at 12:55
Hubert Stettner on I am not ready for a foldable phone at 10:51
Matthias Welling on Tools and Weapons #nowreading at 09:05
Ingo Harpel on You may secretly be a Bing user at 20:01
Amy Blumenfield on Tools and Weapons #nowreading at 19:44
Horia Stanescu on You are famous on Botnet at 12:33
Volker Weber on You are famous on Botnet at 20:17
Dr. Kurt Glasner on You are famous on Botnet at 17:29
Mathias Ziolo on You are famous on Botnet at 14:12
Stephan Herz on You may secretly be a Bing user at 13:45
Volker Weber on Man stelle sich vor, es ist MWC, und keiner geht hin at 20:19
Andy Mell on Man stelle sich vor, es ist MWC, und keiner geht hin at 19:53
Volker Weber on You may secretly be a Bing user at 19:09
René Fischer on You may secretly be a Bing user at 19:02
Roland Dressler on Man stelle sich vor, es ist MWC, und keiner geht hin at 13:00

Ceci n'est pas un blog

I explain difficult concepts in simple ways. For free, and for money. Clue procurement and bullshit detection.

vowe

Contact
Publications
Stuff that works
Amazon Wish List
Frequently Asked Questions

rss feed  twitter  amazon

Local time is 05:47

visitors.gif

Paypal vowe