weblogic SERVERNAME.out log rotation

Written in


Yesterday, there was a problem on one of the dev weblogic servers I am managing. It simply run out of space. The reason was, that log file in $WEBLOGIC_DOMAIN/servers/logs/$MANAGEDSERVER.out grew until it filled up all the disk space. It was obvious that I need to setup some logrotate solution.

This particular log is created by nodemanager which redirects stdout of a managed server to that file. There is no configuration of this in gui what so ever. You can find lot o posts like this one which suggests to use cron to call logrotate unix utility. That works fine, but it is not very elegant solution. I just add, that if you don’t have root permission on the host, you can setup crontab specific for a user like this:

$ crontab -e
00 * * * * /usr/sbin/logrotate -s /tmp/nodemanager_loglotate_status /opt/weblogic/wls/nodemanager/logrotate.conf

There seems to be a better approach – directly configure log rotation in nodemanager.properties:

$ cat nodemanager.properties
# managed1.out log rotation