WAS v8.5 > Script the application serving environment (wsadmin) > Troubleshooting with scriptingTracing operations using wsadmin.sh
We can enable and disable tracing with scripting and wsadmin.
Before starting this task, wsadmin must be running. See the topic about starting wsadmin. Use a trace command to trace operations.
- Enable wsadmin client tracing.
Jacl:
$AdminControl trace com.ibm.*=all
Jython:
AdminControl.trace('com.ibm.*=all')
where:
Syntax explanation. Run the trace command with com.ibm.*=all to enable tracing.
Attribute Definition $ is a Jacl operator for substituting a variable name with its value AdminControl is an object that enables the manipulation of MBeans running in a WebSphere server process trace is an AdminControl command com.ibm.*=all indicates to turn on tracing - Disable wsadmin client tracing.
Jacl:
$AdminControl trace com.ibm.*=info
Jython:
AdminControl.trace('com.ibm.*=info')
where:
Syntax explanation. Run the trace command with com.ibm.*=info to disable tracing.
Attribute Definition $ is a Jacl operator for substituting a variable name with its value AdminControl is an object that enables the manipulation of MBeans running in a WebSphere server process trace is an AdminControl command com.ibm.*=info indicates to turn off tracing
Results
The trace command changes the trace settings for the current session. We can change this setting persistently by editing the wsadmin.properties file. The property com.ibm.ws.scripting.traceString is read by the launcher during initialization. If it has a value, the value is used to set the trace.
The property com.ibm.ws.scripting.traceString can also be passed in as a javaoption through the command line. Passing the property through the command line changes the trace setting for the current session.
Enable Tracing wsadmin.sh -javaoption -Dcom.ibm.ws.scripting.traceString=com.ibm.*=all=enabledA related property, com.ibm.ws.scripting.traceFile, designates a file to receive all trace and logging information. The wsadmin.properties file contains a value for this property. Run wsadmin with a value set for this property. It is possible to run without this property set, where all logging and tracing goes to the dmgr console.
Related
Start the wsadmin scripting client using wsadmin.sh
Enable trace on a running server
Turning traces on and off in servers processes using scripting
Configure traces using scripting
Set up profile scripts to make tracing easier using wsadmin.sh
Dumping threads in server processes using scripting
Use the wsadmin scripting AdminControl object for scripted administration
Reference:
Commands for the AdminControl object using wsadmin.sh