Traces, traces where are you?

This little script reports the saved trace settings in your WAS environment:

import sys
import time
doPrint=0
filename="traces-"+time.strftime("%Y%m%d-%H%M%S")+".log"
result=open("/opt/tools/"+filename,"w")
servers=AdminConfig.list("ApplicationServer").splitlines()
for appserver in servers:    
    server=AdminConfig.list("Server",appserver)
    tc=AdminConfig.list("TraceService",server)
    doPrint=0
    if tc:
        doPrint=1
        currentTrace=AdminConfig.showAttribute(tc,"startupTraceSpecification")
        if currentTrace.find("*=all=disabled")>0:
            doPrint=0
            continue
        if currentTrace.find("*=info") and len(currentTrace) <= 7:
            doPrint=0
            continue
        if doPrint == 1:            
            result.write(server +" : "+ currentTrace +"\n")

result.close()

call it from your dmgr/bin as wsadmin.sh -lang jython -f [path to the code]
This will store the trace settings in the path you specified on line 5….