GAE中基于SLF4j的日志始终显示为警告级别

时间:2013-09-23 17:54:47

标签: google-app-engine slf4j

我在谷歌应用引擎上使用slf4j在各个级别记录了一些消息,但是当我部署应用程序时,所有日志都显示在WARN级别。我搞砸配置怎么样?

private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);
log.debug("debug");
log.error("error");
log.info("info");
log.warn("warn");

enter image description here

Logging.properties

# 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
.level = WARNING

# Set the default logging level for ORM, specifically, to WARNING
DataNucleus.JDO.level=WARNING
DataNucleus.Persistence.level=WARNING
DataNucleus.Cache.level=WARNING
DataNucleus.MetaData.level=WARNING
DataNucleus.General.level=WARNING
DataNucleus.Utility.level=WARNING
DataNucleus.Transaction.level=WARNING
DataNucleus.Datastore.level=WARNING
DataNucleus.ClassLoading.level=WARNING
DataNucleus.Plugin.level=WARNING
DataNucleus.ValueGeneration.level=WARNING
DataNucleus.Enhancer.level=WARNING
DataNucleus.SchemaTool.level=WARNING

com.google.appengine.tools.appstats.AppstatsFilter.level=INFO

1 个答案:

答案 0 :(得分:0)

似乎忽略了您的配置。 将其添加到appengine-web.xml

<!-- Configure java.util.logging -->
<system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>