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 :-)
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.
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. :-)
Post a comment
Recent comments
Ben Poole
on Finally getting started on last.fm at 12:41
Volker Weber
on Finally getting started on last.fm at 12:31
Ben Rose
on Finally getting started on last.fm at 12:22
Yves Luther
on Coming up next Thursday: sticky and sweet at 12:19
Hartmut Wiehr
on Wo gibt es gescheite CD-Läden? at 11:13
Michael Becker
on Wo gibt es gescheite CD-Läden? at 10:26
heiko hebig
on Amazing photos - all taken with a mobile phone at 01:50
Chris Reckling
on Finally getting started on last.fm at 00:53
Alexander Kluge
on Finally getting started on last.fm at 22:31
Volker Weber
on Finally getting started on last.fm at 22:22
Jamey Shiels
on Synchronizing iPhone with ... Lotus Notes at 22:10
Dominik Schwind
on Finally getting started on last.fm at 21:25
Kevin Pettitt
on Showstopper for Lotus Connections at 20:45
Martin Hiegl
on Showstopper for Lotus Connections at 19:27
goran angelov
on iPhone: Can't hear through the receiver or speakers? at 18:53
Sean Cull
on I have seen faster at 18:27
Matthias Leisi
on Coming up next Thursday: sticky and sweet at 18:21
Ted Stanton
on Showstopper for Lotus Connections at 18:17
Handly Cameron
on Showstopper for Lotus Connections at 18:15
Volker Weber
on Showstopper for Lotus Connections at 18:11
Alan Lepofsky
on Showstopper for Lotus Connections at 18:09
Volker Weber
on Showstopper for Lotus Connections at 18:04
Ben Rose
on Showstopper for Lotus Connections at 18:04
Ted Stanton
on Showstopper for Lotus Connections at 17:52
Ben Poole
on Showstopper for Lotus Connections at 17:48



