How to Redirect WLST stdout to a Specified File (Doc ID 1344154.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version: 10.0 and later   [Release: and later ]
Information in this document applies to any platform.

Goal

The customer runs script like the following:

def checkHealth(AdminServer):
 connect('weblogic','weblogic1','t3://localhost:7002')
 redirect('./logs/wlst.log')
 domainRuntime()
 cd('ServerLifeCycleRuntimes')
 cd(serverName)
 status = cmo.getState()
 print "Status of Managed Server is " + status
 stopRedirect()

if __name__== "main":
  checkHealth('AdminServer')

But the output of print "Status of Managed Server is " + status can't be redirected to the log file as expected.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms