Friday, April 17, 2009

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

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

8 comments:

  1. download the code : http://pastebin.com/pastebin.php?dl=m6b1f16f8

    In python Indentations matter. If proper spacing is not there the loop may misbehave

    ReplyDelete
  2. It is working Unni. Thanks alot.

    Krishna.

    ReplyDelete
  3. Using adminHome is a good idea??
    It might be depricated rt??

    I wan to know more details about the logging levels for WebLogic Server. Better you give in clear content with full description would be much scope to reuse your scripr in many domains.

    ReplyDelete
  4. Hey Pavan,

    Will keep ur suggestions in mind.

    Right the ->adminHome<- is depreciated but it works fine with with most of the versions as of now.

    Anyway you said you want to know more about logging ; I would be glad to help if I know the answers.

    Happy scripting :)
    Unni

    ReplyDelete
  5. Hi Unni

    I just want to konw what is the difference between weblogic portal domain and Weblogic server domain.

    Is they any WLST script to create weblogic portal domain and configure all the resource like cluster,machines,oracle JDBC resource,Run Database scripts and configure JMS stores etc

    thanks
    Santhosh

    ReplyDelete
  6. Hi Santu,

    http://forums.oracle.com/forums/thread.jspa?messageID=3431235&#3431235

    hopefully this should help u..

    Cheers :)
    Unni

    ReplyDelete
  7. Hi Santu,

    The main difference between a Weblogic domain and Portal domain is provides a 'portal application development framework' , In addition to a powerful portal framework and its J2EE security foundation, WebLogic Portal provides many business services, such as content management, communities, personalization, search, and user management.

    WebLogic Portal provides a virtual content repository that lets you federate external content management systems into a single management interface. You can then build portals using content in those external resource. WebLogic Portal also provides a WLP content repository for creating and managing content.

    Portal is completely a new ball game for me ;)

    sayonara:)
    Unni

    ReplyDelete
  8. hey unni Marcos needs expanantion on

    serverConfig() and serverRuntime()

    need some help !. .

    ReplyDelete