← All posts

WLST script to change logging setting for all server in the domain

One script to update log settings across all servers

Unni Pillai
Unni Pillai

A continuation of previous post … with a logic which would make changes to all the servers in the domain

Written by Unni on Fri 17 Apr 06:30(IST) download

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

  2. edit()

  3. startEdit()

  4. svrs = adminHome.getMBeansByType(‘Server’)

  5. for s in svrs:

  6.    name = s.getName()

  7.    cd(‘/Servers/’ + name + ‘/Log/’ + name)

  8.    cmo.setNumberOfFilesLimited(true)

  9.    cmo.setFileCount(100)

  10.    cmo.setDomainLogBroadcastSeverity(‘Warning’)

  11.    cmo.setMemoryBufferSeverity(‘Warning’)

  12.    cmo.setLogFileSeverity(‘Warning’)

  13.    cmo.setStdoutSeverity(‘Warning’)

  14. activate()

  15. disconnect()

Time to sleep… Gud Nite :)

Unni