Weblogic does not provide a way to rotate the .out files, basically it can’t because it’s the JVM that’s responsible for creating these.

You can use – UNIX logrotate, More details in this fantastic article, I love this site. (http://www.thegeekstuff.com/2010/07/logrotate-examples) UNIX logrotate

/usr/sbin/logrotate – The logrotate command itself.

/etc/cron.daily/logrotate – This shell script executes the logrotate command everyday.

logrotate.conf options

# see "man logrotate" for details

# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

#Continue to write the log information in the newly created file after rotating the old log file.

copytruncate

 

Examples for rotating .out files

Logrotate monthly, daily, weekly option: Rotate the log file weekly/daily/monthly

Logrotate monthly, daily, weekly option: Rotate the log file weekly/daily/monthly

For doing the rotation monthly once,

Add this logrotate.conf

/<path>/*.out {
        monthly
        copytruncate
        rotate 4
        compress
}

Add the weekly keyword as shown below for weekly log rotation.

Add this logrotate.conf

/<path>/*.out {
        weekly
        copytruncate
        rotate 4
        compress
}

Add the daily keyword as shown below for every day log rotation. You can also rotate logs hourly.

Add this logrotate.conf

/<path>/*.out {
        daily
        copytruncate
        rotate 4
        compress
}

Or just rotate by size

/<path>/*.out {
copytruncate
rotate
size=20Mb
}