Get All Log Categories

This API returns all logger category log levels that are configured in the application and it always serves the current state of the logger.

If a category name is provided in this API as a Path-Variable, it will return a single logger category and level.

1/api/v1/system/logcategories/{LogCategoryName}

If no Path-Variable is define in this API, the API will return a list of logger categories.

1/api/v1/system/logcategories/

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

Method: GET

Request parameters

Gets a single logger log category level. For example:

PortalFQDN]/api/v1/system/logcategories/com.vidyo.customparameter.CustomParameterLogger

 

Field

Data type

Mandatory

Description

Validations

logCategoryName

String

N

Gets single logger log category and level

None

Success response

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

JSON 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 a successful response, the value will be “success”.

data

Parent

Object

N

The parent object which contains a child object logCategories.

logCategories

Parent

Array

Y

The child object of the data. This is the array of logger objects which encapsulates category the API response. It is described in the subsequent rows.

name

 

String

Y

Name of logger that was configured in log4j.xml

level

 

String

Y

Log level currently present in log4j.xml

Sample JSON response

  "version":"1",

  "status":"success",

  "data":{

      "logCategories":[

         {

          "name":"root",

           "level":"INFO"

         }

         {

           "name":"com.package",

           "level":"DEBUG"

         }

         {

           "name":"com.package.sample",

           "level":"DEBUG"

         }

         {

           "name":"mylogger",

           "level":"DEBUG"

         }

      ]

    }

}

Error responses

Occurs if validation of mandatory parameters fails. 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 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.