Modify Log Level for the Logger Category

This API modifies the log level of the logger categories.

URL: [PortalFQDN]/api/v1/system/logcategories

Method: PUT

Request body JSON

   "logCategories":[

      {

        "name":"value1",

        "level":"debug"

      }

      {

        "name":"value11",

        "level":"error"

      }

      {

        "name":"value11",

        "level":"info"

      }

   ]

}

 

Field

Parent

Data type

Mandatory

Description

logCategories

Parent

Array

Y

Array of log category objects.

level

 

String

Y

Log level from which we want to update the existing logger category log level.

name

 

String

Y

Name of logger category whose log level we want to modify.

Success response

In case of success, success code 200 HttpStatus.OK is returned with the JSON content shown below.

JSON response parameters

Field

Data type

Mandatory

Description

version

String

Y

Defines the version of the API.

status

String

Y

Defines the response status. For a successful response, the value will be “success”.

data

Object

N

The element that encapsulates the API response. For this API, its value is null.

Sample JSON response

  "version":"1",

  "status":"success",

  "data":null

}

Error responses

Occurs if validation of mandatory parameters are not passed or invalid parameters pass in the Request body. In this scenario, the list of errors will be returned in the JSON body. The Status code is 400. HttpStatus.BAD_REQUEST.

Error response parameters

Field

Parent

Data type

Mandatory

Description

version

 

String

Y

Defines the version of the API.

status

 

String

Y

Defines the response status. For an Error response, the value will be “failure”.

error

Parent

Object

Y

The element that encapsulates the API error details.

code

 

Integer

Y

The Error code for the error.

message

 

Text

Y

Describes the error.

errors

 

List

N

The list of errors in case of request validation failure.

Its value will be null for all the error scenarios other than request validation failure.

JSON error response structure

  • Request body other than JSON content-type
  • Space/backslash
  • {} empty Request body
  • [] like this

  "version":"1",

  "status":"failure",

  "error":{

      "code”:101003,

      “message”:”Bad request”,

      “errors”:[]

  }

}

JSON error response structure when requested logger category is not present

  "version":"1",

  "status":"failure",

  "error":{

      "code”:101003,

      “message”:”Bad request”,

      “errors”:[

      “Logger category not present”

      ]

  }

}

HTTP status codes, error codes, messages, and error messages

Error responses will be handled the same way as the REST LOGIN API described previously.

HTTP response code

Error code

Error message

Scenario

400

101003

Bad request

Logger category not present

401

 

 

Unauthorized user if anybody other than Super admin tries to access.

500

101004

Internal server error

Could occur due to any unhandled exception scenario.