Uncategorized

STDOUT Rotation Weblogic

As you might know weblogic doesnt provide log rotation for *.out file.  Thats because stdout belongs to JVM not weblogic. Weblogic provides logrotation for .log,access.log and diagnostic logs.

Following are the 3 different ways to rotate your stdout log files in Weblogic.

1) We can use logrotate which comes with default OS to implement stdout rotation.Below is the snippet code that you need to put in your /etc/logrotate.conf file.

 {
rotate 36500
notifempty
size 100k
copytruncate
}

2) We can send all stdout to stdlog file by passing the JVM argument -Dweblogic.log.RedirectStdoutToServerLogEnabled=true. With this we have less maintenance and single log file to look and also we have control of serverlog file in weblogic console.

3) We can create a custom script or wlst scipt  to copy the existing file and do the cat /dev/null , as we usually do when the log files are full.