11.3. Logging Configuration in the CLI
11.3.1. Configure the Root Logger with the CLI
- Display the root logger configuration.
- Change the log level.
- Add log handlers to the root logger.
- Remove log handlers from the root logger.
- Display the Contents of the Root Logger Configuration
- Use the
read-resourceoperation with the following syntax./subsystem=logging/root-logger=ROOT:read-resource
Example 11.1. Root Logger read-resource operation
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:read-resource { "outcome" => "success", "result" => { "filter" => {"match" => "names"}, "handlers" => [ "CONSOLE", "FILE" ], "level" => "INFO" } } - Set the Log Level of the Root Logger
- Use the
write-attributeoperation with the following syntax where LEVEL is one of the supported log levels./subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="LEVEL")
Example 11.2. Root Logger write-attribute operation to set the log level
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:write-attribute(name="level", value=“DEBUG”) {"outcome" => "success"} [standalone@localhost:9999 /] - Add a Log Handler to the Root Logger
- Use the
root-logger-assign-handleroperation with the following syntax where HANDLER is the name of the log handler to be added./subsystem=logging/root-logger=ROOT:root-logger-assign-handler(name="HANDLER")
The log handler must already have been created before it can be added to the root logger.Example 11.3. Root Logger root-logger-assign-handler operation
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:root-logger-assign-handler(name=“AccountsNFSAsync”) {"outcome" => "success"} [standalone@localhost:9999 /] - Remove a Log Handler from the Root Logger
- Use the
root-logger-unassign-handlerwith the following syntax, where HANDLER is the name of the log handler to be removed./subsystem=logging/root-logger=ROOT:root-logger-unassign-handler(name="HANDLER")
Example 11.4. Remove a Log Handler
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:root-logger-unassign-handler(name="AccountsNFSAsync") {"outcome" => "success"} [standalone@localhost:9999 /]

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.