At some expert panel a fortnight ago it was discussed how nice it would be to access the WebLogic logfiles via a simple REST request. Here is how it works:
Configuration
Enable the RESTful management interface in WebLogic under DOMAIN / Configuration / General / Advanced. It’s a non-dynamic change, so restart the admin server.
Access Log Files
Once the RESTful management is enabled simply use your preferred REST client. One possibility is to use the browser either by typing the URI directly and submitting a GET request. Yet a REST plugin as shown below might be the more comfortable option:
For the URI make sure to use host:port of the admin server.
On the response view simply click on the log file that interests you.
Alternatively you can use the UNIX command-line curl:
$ curl --user weblogic:welcome1 -X GET http://localhost:7001/management/wls/latest/servers/id/AdminServer/logs/id/ServerLog
Which URI?
Use the correct SERVER_NAME, e.g. AdminServer in the URI management/wls/latest/servers/id/SERVER_NAME/logs/id/HTTPAccessLog
and replace HTTPAccessLog with the log file you are interested in, such as DataSourceLog, DomainLog, ServerLog.
More?
I explained the benefits of using REST for operations in a previous article which also contains a reference to a 2 minute tech tip recorded by OTN.
Make sure to browse the official Oracle WebLogic documentation here.
Speak Your Mind