Reset Loggers

Resets specified loggers. Once a logger is reset, it restarts logging from scratch. Administrator privileges are required to call this API.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

DELETE /api/sonar/loggers/states
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -X DELETE https://HOSTNAME/api/sonar/loggers/states
Request Parameters
KeyRequiredTypeDescriptionNote
guidsYesList of stringsLogger GUID listComma-separated GUID list

Success Response

{
  "failures": []
}
  • failures (Array of objects): Loggers that failed to reset. An empty array when every logger succeeds.
    • id (String): Identifier of the logger that failed to reset
    • reason (String): Reason for the failure

Error Responses

Logger is not found

HTTP status code 200

{
  "failures": [
    {
      "id": "c1dfe306-abba-4ed8-862b-0e98e2effcb6",
      "reason": "logger-not-found"
    }
  ]
}
Logger identifier is not in valid GUID format

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "guids should be guid type."
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}