Hi,

Jay SenSharma

Jay SenSharma

Sometimes we find that the Server Logs are keep on growing and not getting rotated. Server Logs are not rotating. In this kind of scenarios we can use WLST to Force the WLS to rotate the Server Logs sothat we can reduce the possibility of DiskSpace…

“forceLogRotation.py”

connect('weblogic','weblogic','t3://localhost:7001')
serverRuntime()
ls()
cd('LogRuntime/AdminServer')
ls()
cmo.forceLogRotation()
print 'Log Rotated Successfully It Seems ...Just Check !!!'

Now after running “setWLSEnv.sh”  you can run the above WLST script as following:
java weblogic.WLST  forceLogRotation.py

Now the best thing you can do is …Just write a Shell Script to run as a Daemon process to check that the Log File size is reaching to a perticular limit or not….and once it reaches…if WLS is not able to rotate the Log on it’s own then Run the above WLSt script through your ShellScript…Thats all.

.

.

Thanks

Jay SenSharma

wls:/offline> connect('username','password')

#navigate to the ServerRuntime MBean hierarchy
wls:/mydomain/serverConfig> serverRuntime()
wls:/mydomain/serverRuntime>ls()

#navigate to the server LogRuntimeMBean
wls:/mydomain/serverRuntime> cd('LogRuntime/myserver')
wls:/mydomain/serverRuntime/LogRuntime/myserver> ls()
-r--   Name                                         myserver
-r--   Type                                         LogRuntime

-r-x   forceLogRotation                             java.lang.Void :

#force the immediate rotation of the server log file
wls:/mydomain/serverRuntime/LogRuntime/myserver> cmo.forceLogRotation()
wls:/mydomain/serverRuntime/LogRuntime/myserver>

If you enjoyed this post, please considerleaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.