{"id":732,"date":"2021-04-26T09:58:39","date_gmt":"2021-04-26T07:58:39","guid":{"rendered":"https:\/\/www.ume.li\/blog\/?p=732"},"modified":"2021-04-26T10:00:53","modified_gmt":"2021-04-26T08:00:53","slug":"traces-traces-where-are-you","status":"publish","type":"post","link":"https:\/\/www.ume.li\/blog\/2021\/04\/26\/traces-traces-where-are-you\/","title":{"rendered":"Traces, traces where are you?"},"content":{"rendered":"<p>This little script reports the saved trace settings in your WAS environment:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport sys\r\nimport time\r\ndoPrint=0\r\nfilename=&quot;traces-&quot;+time.strftime(&quot;%Y%m%d-%H%M%S&quot;)+&quot;.log&quot;\r\nresult=open(&quot;\/opt\/tools\/&quot;+filename,&quot;w&quot;)\r\nservers=AdminConfig.list(&quot;ApplicationServer&quot;).splitlines()\r\nfor appserver in servers:    \r\n    server=AdminConfig.list(&quot;Server&quot;,appserver)\r\n    tc=AdminConfig.list(&quot;TraceService&quot;,server)\r\n    doPrint=0\r\n    if tc:\r\n        doPrint=1\r\n        currentTrace=AdminConfig.showAttribute(tc,&quot;startupTraceSpecification&quot;)\r\n        if currentTrace.find(&quot;*=all=disabled&quot;)&gt;0:\r\n            doPrint=0\r\n            continue\r\n        if currentTrace.find(&quot;*=info&quot;) and len(currentTrace) &lt;= 7:\r\n            doPrint=0\r\n            continue\r\n        if doPrint == 1:            \r\n            result.write(server +&quot; : &quot;+ currentTrace +&quot;\\n&quot;)\r\n\r\nresult.close()\r\n<\/pre>\n<p>call it from your dmgr\/bin as wsadmin.sh -lang jython -f [path to the code]<br \/>\nThis will store the trace settings in the path you specified on line 5&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This little script reports the saved trace settings in your WAS environment: import sys import time doPrint=0 filename=&quot;traces-&quot;+time.strftime(&quot;%Y%m%d-%H%M%S&quot;)+&quot;.log&quot; result=open(&quot;\/opt\/tools\/&quot;+filename,&quot;w&quot;) servers=AdminConfig.list(&quot;ApplicationServer&quot;).splitlines()<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[64,63],"class_list":["post-732","post","type-post","status-publish","format-standard","hentry","category-connections","tag-was","tag-websphere"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/comments?post=732"}],"version-history":[{"count":4,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/732\/revisions"}],"predecessor-version":[{"id":737,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/732\/revisions\/737"}],"wp:attachment":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/media?parent=732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/categories?post=732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/tags?post=732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}