How to log in different file? log4j2
问题 I need to log all info to info.log, all warn to warn.log etc and all my logs to all.log. I've been create a log4j2.xml configuration. <?xml version="1.0" encoding="UTF-8"?> <configuration monitorInterval = "3" status = "info"> <appenders> <File name="ALL_LOG" fileName="logs/all.log"> <PatternLayout pattern="%d{ISO8601} [%-5p] (%F:%L) - %m%n"/> </File> <File name="FILE_ERROR" fileName="logs/error.log"> <PatternLayout pattern="%d{ISO8601} [%-5p] (%F:%L) - %m%n"/> </File> <File name="FILE_INFO"