gpt4 book ai didi

java - 如何超越LogManager警告?

转载 作者:行者123 更新时间:2023-12-01 14:00:36 24 4
gpt4 key购买 nike

编译并运行我的应用程序后,我的控制台中将显示以下错误,我不知道如何超越它们。

INFO: PWC1412: WebModule[null] ServletContext.log():Closing Spring root WebApplicationContext
SEVERE: log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
INFO: PWC1412: WebModule[null] ServletContext.log():No Spring WebApplicationInitializer types detected on classpath
INFO: Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context ''
SEVERE: log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
SEVERE: log4j:WARN Please initialize the log4j system properly.

最佳答案

您似乎尚未配置 log4j 记录器,请在类路径中添加 log4j.properties 文件。

基本的 log4j.properties 文件可以是

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=OFF, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Docs

关于java - 如何超越LogManager警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19372811/

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