I use logj2
log4j2.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration monitorInterval="3"> <appenders> <File name="FILE" fileName="logs/error.log"/> </appenders> <loggers> <root level="error"> <appender-ref ref="FILE"/> </root> </loggers> </configuration> There is MainClass: Start
If I write in Start
public static Logger log = LogManager.getLogger(Start.class); then everything is fine, the logs are written If I write such lines, for example in SomeClass
public static Logger log = LogManager.getLogger(SomeClass.class); then log4j issues at runtime
log4j: WARN No appenders could be found for logger (some.SomeClass). and logs are not written for this class