csw-admin-server
A HTTP server application that supports changing/getting log level of component.
Prerequisites
A required check before starting csw-admin-server app is to ensure the csw-cluster is setup and location sever is available so that using HTTP location client, it can resolve components for which log level needs to be fetched/changed.. Kindly refer to CSW Location Server for more information about location server setup.
Command line parameter options
--port
is an optional parameter. When specified the HTTP server will start on this port. Default is 7878.--locationHost
is an optional parameter. Indicates the host address of machine where location server is running. Default is localhost.--help
prints the help message.--version
prints the version of the application.
Examples
-
Start HTTP server on default port 7878.csw-admin-server
This requires that location server is running locally
-
Start HTTP server on default port 7878.csw-admin-server --locationHost 172.1.1.2
This indicates, location server is running on remote machine having ip address=172.1.1.2
-
Start HTTP server on port 8080.csw-admin-server --port 8080
-
csw-admin-server --help
Prints help message
-
csw-admin-server --version
Prints application version
## Accessing csw-admin-server routes via HTTP (curl)
- Get LogMetadata : Returns current log level of component along with default, akka and slf4j log levels.
-
Request:
curl -X GET 'http://10.131.21.184:7878/admin/logging/trombone-hcd-akka/level'
-
Response:
{ "defaultLevel": "DEBUG", "akkaLevel": "ERROR", "slf4jLevel": "INFO", "componentLevel": "DEBUG" }
- Set Log Level : Sets the log level of component and returns with status code 200 OK
- Request:
curl -X POST 'http://10.131.21.184:7878/admin/logging/trombone-hcd-akka/level?value=DEBUG'
Assuming csw-admin-server is running on IP 10.131.21.184 on port 7878.