tags:

views:

15

answers:

1

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 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?

A: 

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.

Rick