Retrieving or changing logging level
Cloudera Data Visualization Admin API provides a convenient way to manage logging levels for specific loggers, allowing you to control the verbosity of log messages as needed. It supports retrieving and changing the logging level for a specified logger within the system.
- GET:
/arc/adminapi/loglevel/<logger-name>
- POST:
/arc/adminapi/loglevel/<logger-name>
- POST parameters
-
The POST endpoint expects a JSON document in the request body. The JSON document should contain a single field,
level
, specifying the desired log level. It accepts one of the predefined names in the Python logging module:- CRITICAL
- DEBUG
- ERROR
- FATAL
- INFO
- WARN
- WARNING
- Authentication
-
Both API key and session-based authentication are accepted. The retrieval of the logging level does not require any special permissions. However, updating the logging level requires the sys_viewlogs permission.
Getting the current loglevel for the arcweb logger:
- Request
curl -H 'content-type:application/json' -H 'authorization: apikey <API-KEY>' <VIZ_URL>/arc/adminapi/loglevel/arcweb
- Response
{ "logger": "arcweb", "level": "INFO" }
Setting the log level to DEBUG for arcweb:
- Request
curl -H 'content-type:application/json' -H 'authorization: apikey <API-KEY>' <VIZ_URL>/arc/adminapi/loglevel/arcweb -d '{"level":"DEBUG"}'
- Response
{ "logger": "arcweb", "level": "DEBUG" }