WLST Script to enable Log4j Logger on WebLogic Server
WLST Script to enable Log4j Logger on WebLogic Server


By default, WebLogic Server logging service uses an implementation based on the Java Logging APIs.

Using the LogMBean.isLog4jLoggingEnabled attribute, you can direct the logging services to use Log4j instead.

C:\>java weblogic.WLST

# connect Administration Server
wls:/offline> connect('uname','password')

# Start an edit session and navigating to the logging mbean for the server names myserver
wls:/mydomain/serverConfig> edit()
wls:/mydomain/edit> startEdit()
wls:/mydomain/edit !> cd("Servers/myserver/Log/myserver")

# enable log4j
wls:/mydomain/edit/Servers/myserver/Log/myserver !> cmo.setLog4jLoggingEnabled(true)

#save and activate the changes
wls:/mydomain/edit/Servers/myserver/Log/myserver !> save()
wls:/mydomain/edit/Servers/myserver/Log/myserver !> activate()

Java Logging is the default for client and server-side logging; Log4j is available only for server-side and not client-side logging.

Cheers :)

Unni

comments here

January 19, 2010
100 words


Categories
Tags
example hugox blog

Connect. Socialize.

Sponsors