in log4j I could specify a class in the properties file to log at the debug level like this:
log4j.logger.com.mycompany.mypackage.ClassName=DEBUG
How do I do this in log4j2? Note I still need to use the new property file (not xml or json).
TIA
in log4j I could specify a class in the properties file to log at the debug level like this:
log4j.logger.com.mycompany.mypackage.ClassName=DEBUG
How do I do this in log4j2? Note I still need to use the new property file (not xml or json).
TIA
As the log4j2 configuration documentation states
It then provides a substantial example for all types of configuration elements.
Concerning your question, you need to specify your loggers in a
loggers
element, then configure each of them. For exampleNote that log4j2 looks for a
.properties
file on the classpath by default.But you can also configure the location yourself. You can use the system property
with an appropriate path.