Thursday, April 25, 2013

Rotation of .out log files created by node manager

Unfortunately there is no way provided with node manager or weblogic to rotate your .out log files created by node manager , you have to manually cleanup them or you can use  any of the below method to auto cleanup the same.

1st Method
----------
-----

You can redirect .out logs to the .log file and managed .log via admin console.
[ console > your_server > under logging tab ]

Fot this -

Go to to YOUR_DOMAIN/bin/nodemanager
Take a backup of your existing wlscontrol.sh
Edit it and change OutFile=$ServerDir/logs/$ServerName.out to OutFile=$ServerDir/logs/$ServerName.log




2nd Method
-----------
------

on Linux, You can change OS parameters in /etc/logrotate.conf file

Append below lines at the end

<out_log_file_dir_path>/*.out
{
copytruncate
rotate 4
size=500Mb
}

OR

Use command "logrotate" using cron to achieve, You can use it with copytruncate to rotate logs.


3rd Method
-----------
-----

Add option -Dweblogic.log.RedirectStdoutToServerLogEnabled=true to redirect .out logs to .log log file and manage it via admin console

[ console > your_server > under logging tab ]

No comments: