1

我在谷歌应用引擎上使用 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");

在此处输入图像描述

日志记录.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
4

1 回答 1

0

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

<!-- Configure java.util.logging -->
<system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
于 2014-12-10T23:17:39.367 回答