WLST script to change logging setting for AdminServer
Set rotation, severity, and HTTP log limits in one script
This posting answers the questions asked in http://forums.oracle.com/forums/thread.jspa?forumID=570&threadID=886625
Written by Unni on Thu 16 Apr 18:55(IST) download
-
print(‘Connectting to Admin Server’)
-
connect(‘weblogic’,‘weblogic’,‘t3://localhost:7001’)
-
print(‘Stating a New Edit Session’)
-
edit()
-
startEdit()
-
print(‘Navigating to Servers/AdminServer/Log/AdminServer MBean’)
-
cd(‘/Servers/AdminServer/Log/AdminServer’)
-
print(‘Setting NumberOfFilesLimited to true’)
-
cmo.setNumberOfFilesLimited(true)
-
print(‘Setting FileCount to 10’)
-
cmo.setFileCount(10)
-
print(‘Setting DomainLogBroadcastSeverity to Critical’)
-
cmo.setDomainLogBroadcastSeverity(‘Critical’)
-
print(‘Setting MemoryBufferSeverity to Critical’)
-
cmo.setMemoryBufferSeverity(‘Critical’)
-
print(‘Setting LogFileSeverity to Info’)
-
cmo.setLogFileSeverity(‘Info’)
-
print(‘Setting StdoutSeverity to Error’)
-
cmo.setStdoutSeverity(‘Error’)
-
print(‘\n\n --- \n\n’)
-
print(‘Navigating to Servers/AdminServer/WebServer/AdminServer/WebServerLog/AdminServer**\n**’)
-
cd(‘/Servers/AdminServer/WebServer/AdminServer/WebServerLog/AdminServer’)
-
print(‘Setting NumberOfFilesLimited to true’)
-
cmo.setNumberOfFilesLimited(true)
-
print(‘Setting FileCount to 10**\n\n**’)
-
cmo.setFileCount(15)
-
# Activate changes to the Domin Cofiguration
-
activate()
-
# Disconnect from Admin Server
-
disconnect()
-
# Exiting WLST
-
exit()
Cheers :)
Unni