Tuesday, May 3, 2016

WebLogic Server log rotation of stdout

1. Run this command:
crontab -e
2. Save the following cron job:
0,15,30,45 * * * * /usr/sbin/logrotate -s $HOME/scripts/logrotate.out $HOME/scripts/logrotate.conf
3. Search for all .out files on the server to find out what needs to be rotated:
find /u01 -name "*.out"
4. Run these command:
mkdir -p ~/scripts 
vi ~/scripts/logrotate.conf
5. Add an entry for every .out file on the server. This is an example:
/u01/app/oracle/middleware/wlserver_10.3/server/bin/nodemanager.out {
    missingok
    copytruncate
    compress
    rotate=10
    size=50M
}
/u01/app/oracle/middleware/user_projects/domains/soadomain/servers/AdminServer/logs/AdminServer.out {
    missingok
    copytruncate
    compress
    rotate=10
    size=50M
}
/u01/app/oracle/middleware/user_projects/domains/soadomain/servers/soa_server1/logs/soa_server1.out {
    missingok
    copytruncate
    compress
    rotate=10
    size=50M
}

Applicable Versions
  • Oracle WebLogic Server 11g

 

No comments: