It is not possible to constantly change log detail levels using a Jython script (WAS 7)

I am trying to change the detail levels of a WebSphere log using a Jython script:

.. AdminTask.setTraceSpecification('[-serverName server1 -nodeName qnode -traceSpecification com.ibm.*=all=enabled]') AdminConfig.save() .. 

After running the script successfully, I check "Logging and tracing> {server_name → Diagnostic trace service> Change log detail levels. The Runtime tab reflects the (traceSpecification) setting I entered in my script, but the" Configuration "tab remains unchanged, so my setting is not saved in the configuration, I tried to restart my server, so I’m sure of that.

According to the documentation for setTraceSpecification, this "command also saves the trace specification in the configuration." Well, not in my case :) Do you have any idea what I'm doing wrong?

Any help would be greatly appreciated

0
source share
2 answers

As I found out, setTraceSpecification () also has a persist parameter that must be set if you want to constantly change the settings for the WAS configuration:

 .. AdminTask.setTraceSpecification('[-serverName myserver -nodeName mynode -persist true -traceSpecification com.ibm.*=all=enabled]') AdminConfig.save() .. 

Unfortunately, the WAS 7 InfoCenter does not have a word about this option, while the WebSphere CloudBurst Appliance InfoCenter has an example that includes it.

+1
source

I think you may need to save the configuration in a script:

 if (AdminConfig.hasChanges()): AdminConfig.save() 
0
source

Source: https://habr.com/ru/post/976040/


All Articles