[[loggers]]
= Loggers (`loggers`)
The `loggers` endpoint provides access to the application's loggers and the configuration of their levels.



[[loggers.all]]
== Retrieving All Loggers
To retrieve the application's loggers, make a `GET` request to `/actuator/loggers`, as shown in the following curl-based example:

include::{snippets}/loggers/all/curl-request.adoc[]

The resulting response is similar to the following:

include::{snippets}/loggers/all/http-response.adoc[]



[[loggers.all.response-structure]]
=== Response Structure
The response contains details of the application's loggers.
The following table describes the structure of the response:

[cols="3,1,3"]
include::{snippets}/loggers/all/response-fields.adoc[]



[[loggers.single]]
== Retrieving a Single Logger
To retrieve a single logger, make a `GET` request to `/actuator/loggers/{logger.name}`, as shown in the following curl-based example:

include::{snippets}/loggers/single/curl-request.adoc[]

The preceding example retrieves information about the logger named `com.example`.
The resulting response is similar to the following:

include::{snippets}/loggers/single/http-response.adoc[]



[[loggers.single.response-structure]]
=== Response Structure
The response contains details of the requested logger.
The following table describes the structure of the response:

[cols="3,1,3"]
include::{snippets}/loggers/single/response-fields.adoc[]



[[loggers.group]]
== Retrieving a Single Group
To retrieve a single group, make a `GET` request to `/actuator/loggers/{group.name}`,
as shown in the following curl-based example:

include::{snippets}/loggers/group/curl-request.adoc[]

The preceding example retrieves information about the logger group named `test`.
The resulting response is similar to the following:

include::{snippets}/loggers/group/http-response.adoc[]



[[loggers.group.response-structure]]
=== Response Structure
The response contains details of the requested group.
The following table describes the structure of the response:

[cols="3,1,3"]
include::{snippets}/loggers/group/response-fields.adoc[]



[[loggers.setting-level]]
== Setting a Log Level
To set the level of a logger, make a `POST` request to `/actuator/loggers/{logger.name}` with a JSON body that specifies the configured level for the logger, as shown in the following curl-based example:

include::{snippets}/loggers/set/curl-request.adoc[]

The preceding example sets the `configuredLevel` of the `com.example` logger to `DEBUG`.



[[loggers.setting-level.request-structure]]
=== Request Structure
The request specifies the desired level of the logger.
The following table describes the structure of the request:

[cols="3,1,3"]
include::{snippets}/loggers/set/request-fields.adoc[]



[[loggers.group-setting-level]]
== Setting a Log Level for a Group
To set the level of a logger, make a `POST` request to `/actuator/loggers/{group.name}` with a JSON body that specifies the configured level for the logger group, as shown in the following curl-based example:

include::{snippets}/loggers/setGroup/curl-request.adoc[]

The preceding example sets the `configuredLevel` of the `test` logger group to `DEBUG`.



[[loggers.group-setting-level.request-structure]]
=== Request Structure
The request specifies the desired level of the logger group.
The following table describes the structure of the request:

[cols="3,1,3"]
include::{snippets}/loggers/set/request-fields.adoc[]



[[loggers.clearing-level]]
== Clearing a Log Level
To clear the level of a logger, make a `POST` request to `/actuator/loggers/{logger.name}` with a JSON body containing an empty object, as shown in the following curl-based example:

include::{snippets}/loggers/clear/curl-request.adoc[]

The preceding example clears the configured level of the `com.example` logger.
