Java AppEngina上的Log4j->;显示的所有日志消息具有相同的日志级别

Java AppEngina上的Log4j->;显示的所有日志消息具有相同的日志级别,java,google-app-engine,logging,log4j,Java,Google App Engine,Logging,Log4j,我的日志消息始终在应用程序引擎日志控制台中显示为“info”,即使我将消息记录为错误(请参见屏幕截图) 我会记录这样的消息: private static Logger logger = Logger.getLogger(PingServlet.class); logger.error("Database was successfully pinged!!."); 系统配置如下: src/main/resources/log4j.properties # Root logger option

我的日志消息始终在应用程序引擎日志控制台中显示为“info”,即使我将消息记录为错误(请参见屏幕截图)

我会记录这样的消息:

private static Logger logger = Logger.getLogger(PingServlet.class);
logger.error("Database was successfully pinged!!.");
系统配置如下:

src/main/resources/log4j.properties

# Root logger option
log4j.rootLogger=INFO, stdout

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# A default java.util.logging configuration.
# (All App Engine logging is through java.util.logging by default).
#
# To use this configuration, copy it into your application's WEB-INF
# folder and add the following to your appengine-web.xml:
# 
# <system-properties>
#   <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
# </system-properties>
#

# Set the default logging level for all loggers to WARNING
.level = INFO
src/main/webapp/WEB-INF/logging.properties

# Root logger option
log4j.rootLogger=INFO, stdout

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# A default java.util.logging configuration.
# (All App Engine logging is through java.util.logging by default).
#
# To use this configuration, copy it into your application's WEB-INF
# folder and add the following to your appengine-web.xml:
# 
# <system-properties>
#   <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
# </system-properties>
#

# Set the default logging level for all loggers to WARNING
.level = INFO
#默认的java.util.logging配置。
#(默认情况下,所有应用程序引擎日志记录都是通过java.util.logging进行的)。
#
#要使用此配置,请将其复制到应用程序的WEB-INF中
#文件夹,并将以下内容添加到appengine-web.xml中:
# 
# 
#   
# 
#
#将所有记录器的默认日志记录级别设置为“警告”
.级别=信息


我怎样才能改变这一点?我想将错误显示为错误,以此类推。

如果您使用log4j进行日志记录,则日志消息将通过ConsolePender打印到“控制台”,然后AppEngina将其收集到自己的日志中。您拥有的两个日志部分未连接


您需要直接使用java.util.logging而不是log4j,或者使用slf4将log4j重定向到java.util.logging(有点棘手,请仔细阅读文档)

有什么问题?在编码时显示为错误。