senleft
senleft

Reputation: 511

How change the logging level at runtime for IBM Liberty server?

The IBM WAS8 allows changing the logging level at runtime via API. How to do the same thing for IBM Liberty server without changing the server.xml? I think this is possible via defining custom API, e.g. REST endpoint that will do this. Is the vendor recommended way to do it?

Upvotes: 0

Views: 1516

Answers (1)

M. Broz
M. Broz

Reputation: 738

Liberty does not provide an API equivalent to change logging levels. You can make the change at runtime (no restart required) by directly changing the server.xml or by changing the server.xml through Admin Center's Server Config tool (available in WebSphere Liberty, but not Open Liberty). I mention the latter because Admin Center uses public APIs for everything including making changes to the server.xml which means you could technically make the same API calls to change the server.xml to include your logging changes at runtime. However, the drawback with that approach is that you'd have to use the file transfer API to read the server.xml, then make appropriate changes to it, and then use file transfer API again to persist the changes.

If you'd like to see an API for changing log levels, I would recommend opening an RFE (https://developer.ibm.com/wasdev/help/submit-rfe/)

Upvotes: 1

Related Questions