Reputation: 796
Is it possible in JBoss logging subsystem configuration to set root log level to "INFO" and to define lower level such as "DEBUG" for a specific package ?
Upvotes: 0
Views: 568
Reputation: 17825
Yes, that is possible. For clarity loggers are defined by names and not packages. That said, the typical logger names are class/package names. If you have a class named org.wildfly.example.SimpleResource
and you get the logger like Logger.getLogger(SimpleResource.class)
your logger name is org.wildfly.example.SimpleResource
.
By default the root logger is set to INFO. If you want to add debug logging for your logger, you can do that in CLI or the HAL web console. A CLI example would look like:
/subsystem=logging/logger=org.wildfly.example.SimpleResource:add(level=DEBUG)
If you want to see debug messages on the console you likely need to do something like this too:
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=level, value=DEBUG)
You can also be more generic with the logger name to add debugging for all loggers within the name segments.
/subsystem=logging/logger=org.wildfly.example:add(level=DEBUG)
Upvotes: 0