Set Logger Debug Levels

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Subscription Information

This feature is supported on the Self-Hosted platform, with a Pro, Pro X, Enterprise X, or Enterprise+ license.

Description: Defines a temporary debug level for one or more loggers in memory without changing the logback.xml file. This request can be used to collect more detailed log information for a short period of time to help investigate a particular issue. When the defined time interval expires, the logger debug level is reset to its previous value.

Note

In HA environments, the debug level is propagated so that all nodes have the same log level.

Tip

This API was intended for customers whose security protocols prevent accessing the loggers remotely via SSH. It is strongly recommended to contact JFrog Support before using this API. A support representative will provide the names of the loggers to include in the request and the desired debug level.

Since: 7.77.0

Security: Requires an admin user

Usage: POST /artifactory/api/system/debug/loggers

Content-Type: application/json

Sample Usage:

curl -uadmin:password -H "Content-Type: application/json" -X POST -d '{
  "classes": {
    "org.dummy.Class": "debug",
    "org.dummy.OtherClass": "INFO"
  }, "timer": 60
}' https://<Artifactory_URL>/artifactory/api/system/debug/loggers

The request includes the following information:

Field

Mandatory/Optional

Type

Description

classes 

mandatory

array

The names of the loggers whose debug level you want to change temporarily (for example, com.jfrog.bh), and the debug level to define for each one. Debug levels include:

  • trace 

  • debug 

  • info 

  • warn 

  • error 

  • fatal 

Each logger you want to configure must be specified individually by name. The maximum number of loggers that can be configured is 100.

timer 

mandatory

integer

The amount of time to keep the loggers at the defined debug level (in seconds). When the interval expires, the loggers are reset to the previous debug level.

Sample Response:

Logger levels configured successfully

Note

To return to the previous debug level before the timer expires, use the Delete Logger Debug Levels API.

Warning

Do not sent a new POST request until the previous POST request has expired. If you want to change the debug level configuration, first send a DELETE request to undo the previous POST and only then execute a new POST request.

Status Codes:

Code

Description

200

Submitted

400

Bad Request

Examples include:

  • No loggers defined

  • Too many loggers defined (maximum is 100)

  • timer set to < 0

401

Bad Credentials

403

Forbidden

Note

If any of the classes defined in the request do not exist, the POST operation will still complete. Therefore, before making a correction, you must either wait for the timer to expire or execute a DELETE operation before sending a new POST request.