You can achieve a lot of things with the RESTFul Management Services, like creating DataSources, perform deployments, startup and shutdown Managed Servers and so on.
But you also can access the different WebLogic Server Logfiles :-)
Let's say your developers needs access to the Logfiles of your Oracle WebLogic Server, but you don't want to give them access to your Server which is hosting your Oracle WebLogic Server.
Just create a new User in your WebLogic Admin Console and give this new User the Group "Monitor". With the Monitor Group you can access the WebLogic RESTFul Management Services.
Now your developers can retrieve the Logfiles with a simple cURL command from their desktops:
For the LogType you have following options:
- DomainLog (only for AdminServer)
# Replace the Server Name and Port with your values # Replace the AdminServer Name "PRODAdminServer" with your AdminServer Name # curl -s --user RESTAdmin:welcome1 \ -H X-Requested-By:MyClient \ -H Accept:application/json \ -X GET http://wls122:7101/management/wls/latest/servers/id/PRODAdminServer/logs/id/DomainLog > domain.log
or like this:
# Replace the Server Name and Port with your values # Replace the Managed Server Name "Prod_ManagedServer1" with your Managed Server Name # curl -s --user RESTAdmin:welcome1 \ -H X-Requested-By:MyClient \ -H Accept:application/json \ -X GET http://wls122:7101/management/wls/latest/servers/id/Prod_ManagedServer1/logs/id/ServerLog > Prod_ManagedServer1_ServerLog.log
The corresponding Logfile retrieval in JSON format will look as follows:
Managed Server ServerLog: