Wednesday, November 30, 2011

Rotate .out log files

1) If you are using nodemanager you can redirect .out to .log and control them via console (server -> logging tab under console)
traverse to */user_projects/domains/base_domain/bin/nodemanager
take a backup of and edit it
change OutFile=$ServerDir/logs/$ServerName.out to OutFile=$ServerDir/logs/$ServerName.log


2) You can make changes to the OS parameters under /etc/logrotate.conf
add the below lines at the end of the file

<Location of logs directory>/*.out
rotate 4


3)Add the flag  -Dweblogic.log.RedirectStdoutToServerLogEnabled=true to redirect .out to .log and control them via console (server -> logging tab under console)
and if you are starting via nodemanager add below additional parameters under */wlserver_10.3/common/nodemanager


4)Use OS command "logrotate" (via cron) to achieve your target. You can combine it with copytruncate to rotate logs.


Anon said...

I tried the third option which seemed to be the easy one 3)Add the flag -Dweblogic.log.RedirectStdoutToServerLogEnabled=true to redirect .out to .log and control them via console.

the .out file is still updating. So going with the first option now.

David Hergert said...

Did you have better luck with the other option? And do you know why the first option didn't work?

Narasimhulu M said...

hi What is the difference between servername.log servername.out log files.
which information will contains both files? suppose i want check application related errors which file i want check?

Anonymous said...

I have combined steps 1 and 3 and it's working just fine.