← All posts

WLST script to change logging setting for AdminServer

Set rotation, severity, and HTTP log limits in one script

Unni Pillai
Unni Pillai

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

  1. print(‘Connectting to Admin Server’)

  2. connect(‘weblogic’,‘weblogic’,‘t3://localhost:7001’)

  3. print(‘Stating a New Edit Session’)

  4. edit()

  5. startEdit()

  6. print(‘Navigating to Servers/AdminServer/Log/AdminServer MBean’)

  7. cd(‘/Servers/AdminServer/Log/AdminServer’)

  8. print(‘Setting NumberOfFilesLimited to true’)

  9. cmo.setNumberOfFilesLimited(true)

  10. print(‘Setting FileCount to 10’)

  11. cmo.setFileCount(10)

  12. print(‘Setting DomainLogBroadcastSeverity to Critical’)

  13. cmo.setDomainLogBroadcastSeverity(‘Critical’)

  14. print(‘Setting MemoryBufferSeverity to Critical’)

  15. cmo.setMemoryBufferSeverity(‘Critical’)

  16. print(‘Setting LogFileSeverity to Info’)

  17. cmo.setLogFileSeverity(‘Info’)

  18. print(‘Setting StdoutSeverity to Error’)

  19. cmo.setStdoutSeverity(‘Error’)

  20. print(‘\n\n --- \n\n’)

  21. print(‘Navigating to Servers/AdminServer/WebServer/AdminServer/WebServerLog/AdminServer**\n**’)

  22. cd(‘/Servers/AdminServer/WebServer/AdminServer/WebServerLog/AdminServer’)

  23. print(‘Setting NumberOfFilesLimited to true’)

  24. cmo.setNumberOfFilesLimited(true)

  25. print(‘Setting FileCount to 10**\n\n**’)

  26. cmo.setFileCount(15)

  27. # Activate changes to the Domin Cofiguration

  28. activate()

  29. # Disconnect from Admin Server

  30. disconnect()

  31. # Exiting WLST

  32. exit()

Cheers :)
Unni