Can I dynamically update the websphere 's log configuration in my own code?
In websphere admin console, we can change the log configuration , for example, the log file name, rolloverSize and log level and so on. After we saved the change in console, if we choose run time and chose write the file to xml. In this case, the log configuraiton change will be write to config file (such as: \config\cells\SENLI-XPNode01Cell\nodes\SENLI-XPNode01\servers\server1\server.xml)
You know websphere support the dynamically change the log configuraiton, after we开发者_StackOverflow社区 changed it, it will take effect immidiately.
My quesiton is that in my own code, is there any websphere public api we can invoke to implement the dynamically change the log configuraiton?
You use the AdminClient to look up the TraceService MBean and update the trace string via that interface.
To modify the values saved in xml you can use the ConfigService to programmatically. I'll warn you that this approach isn't for the faint of heart.
精彩评论