0

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?

senleft
  • 483
  • 1
  • 4
  • 17

1 Answers1

1

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/)

M. Broz
  • 704
  • 4
  • 11
  • Thank you! I will submit RFE. It is a bit strange decision. Someone thought that developer will have access to file system of the prod server to change in runtime the logging level of the specific component. – senleft Nov 14 '18 at 15:20
  • 1
    I would suggest an easier way to update than changing server.xml itself would be to just create a new file in the configDropins/overrides directory with just the new config you want to set. For example `` – dbourne Nov 23 '18 at 15:02