Configuring loggers
Each time a log event is emitted, it contains information about the log level and the fully qualified class name bound to that event. In order to associate this information with a specific handler, you can use loggers.
Loggers are associated with a specific namespace, hence they have a hierarchy that contains, at the root, the root logger that is the ancestor of all loggers. All classes that don't have a configured logger will therefore be captured by the root logger. The root logger by default is associated with the CONSOLE
and FILE
handlers. You can vary it by specifying the list of Handlers as follows:
/subsystem=logging/root-logger=ROOT/:write-attribute(name=handlers,value=["CONSOLE","FILE","SYSLOG"])
By default, the root logger traces logs with the INFO (or higher) level. You can change at any time the root logger level through the change-root-log-level
operation. For example:
/subsystem=logging/root-logger=ROOT/:change-root-log-level(level=WARN)