1

So I've tried configuring AppEngine logging according to this guide, ensuring I've configured the logging.properties file to be used in web.xml. I've configured logging.properties the following way:

.level = WARNING
nilsnett.chinese.backend.level = INFO 

The package name of my logging wrapper is nilsnett.chinese.backend. The problem is that even with this configuration, info-level log output from my app is filtered. Evidence:

enter image description here

I've also tried the following config, which yielded the same result (including the logger class name at the end of the package name):

.level = WARNING
nilsnett.chinese.backend.JavaUtilLogger.level = INFO

To demonstrate that the logging.properties-file is actually read, and that I actually do write info-level logging data to app-engine in this service call, let me show you what happens when I set.level=INFO:

enter image description here

So my desired result is to have INFO and higher-level log outputs from my packages, while other packages, like org.datanucleus, only shows output if WARNING or more severe. In the example above, I want only the two lines marked with the purple star. Am I doing anything wrong?

4

1 に答える 1

1

設定を次のように変更します。

.level = WARNING

# Set the default logging level for the datanucleus loggers
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

# FinalizableReferenceQueue tries to spin up a thread and fails.  This
# is inconsequential, so don't scare the user.
com.google.common.base.FinalizableReferenceQueue.level=WARNING
com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue.level=WARNING

これはログ設定テンプレートから来ているので、datanucleus を警告に設定するには、このテンプレートのようにする必要があります。
https://developers.google.com/appengine/docs/java/#Logging

そして、独自のログ構成を追加するだけです:

nilsnett.chinese.backend.level = INFO 

これで解決するはずです

于 2013-06-26T10:55:39.280 に答える