[id='configuring-server-logs-cli_{context}']
= Changing {brandname} Server logging configuration at runtime

Modify the logging configuration for {brandname} Server at runtime to
temporarily adjust logging to troubleshoot issues and perform root cause
analysis.

Modifying the logging configuration through the CLI is a runtime-only
operation, which means that changes:

* Are not saved to the `log4j2.xml` file. Restarting server nodes or the entire cluster resets the logging configuration to the default properties in the `log4j2.xml` file.
* Apply only to the nodes in the cluster when you invoke the CLI. Nodes that join the cluster after you change the logging configuration use the default properties.

.Procedure

. Create a CLI connection to {brandname} Server.
. Use the [command]`logging` to make the required adjustments.

* List all appenders defined on the server:
+
[source,options="nowrap",subs=attributes+]
----
logging list-appenders
----
+
The command provides a JSON response such as the following:
+
[source,json,options="nowrap",subs=attributes+]
----
include::json/server_logging_appenders.json[]
----

* List all logger configurations defined on the server:
+
[source,options="nowrap",subs=attributes+]
----
logging list-loggers
----
+
The command provides a JSON response such as the following:
+
[source,json,options="nowrap",subs=attributes+]
----
include::json/server_logging_list.json[]
----

* Add and modify logger configurations with the [command]`set` subcommand
+
For example, the following command sets the logging level for the
`org.infinispan` package to `DEBUG`:
+
[source,options="nowrap",subs=attributes+]
----
logging set --level=DEBUG org.infinispan
----

* Remove existing logger configurations with the [command]`remove` subcommand.
+
For example, the following command removes the `org.infinispan` logger
configuration, which means the root configuration is used instead:
+
[source,options="nowrap",subs=attributes+]
----
logging remove org.infinispan
----
