Can't change log detail levels permanently with a Jython script (WAS 7)

跟風遠走 提交于 2019-12-13 03:00:31

问题


I'm trying to change WebSphere's Log Detail Levels with a Jython script:

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

After successfully running the script I'm checking "Logging and Tracing > {server_name} > Diagnostic trace service > Change log detail levels. The Runtime tab reflects the setting (the traceSpecification) I've entered in my script, but the Configuration tab remains unchanged, so, my setting doesn't get saved to configuration. I've tried restarting my server, so I'm sure about that's the case.

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

Any help would be much appreciated


回答1:


As I've found out, setTraceSpecification() also has a persist parameter which has to be set if you want to change your setting permanently to WAS configuration:

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

Unfortunately, WAS 7 InfoCenter doesn't have a single word about this option, while WebSphere CloudBurst Appliance InfoCenter has an example which includes it.




回答2:


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

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


来源:https://stackoverflow.com/questions/12383413/cant-change-log-detail-levels-permanently-with-a-jython-script-was-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!