gpt4 book ai didi

java - Log4j 属性给出错误

转载 作者:行者123 更新时间:2023-11-29 03:05:30 25 4
gpt4 key购买 nike

我收到了错误信息

log4j:WARN No appenders could be found for logger (com.faktorZehn.socialNetwork.socialNetwork.PersonGenerator).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

enter image description here

我的属性看起来像

 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

有什么地方做错了吗?

最佳答案

您的资源文件夹不在您的类路径中。右键单击文件夹 -> Build Path -> Use as source folder.

然后重新运行您的应用程序,您的 log4j.properties 应该被 log4j 框架使用。

关于java - Log4j 属性给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32412530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com