我已经把log4j放到了我的buildpath中,但是当我运行我的应用程序时,我得到了以下消息:
log4j:WARN No appenders could be found for logger (dao.hsqlmanager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
这些警告是什么意思?这里的阑尾是什么?
这个网站上的解决方案为我工作https://crunchify.com/java-how-to-configure-log4j-logger-property-correctly/。现在我在log4j中没有看到任何警告
我把它放在log4j中。我把它放在src/main/resources中
# This sets the global logging level and specifies the appenders
log4j.rootLogger=INFO, theConsoleAppender
# settings for the console appender
log4j.appender.theConsoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.theConsoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.theConsoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n