How to set loglevel of the Appengine DataStore in

2019-06-28 04:56发布

I have a logging.properties file in my Java AppEngine project (using java.util.logging) that looks like this:

# Set the default logging level for all loggers to WARNING
.level = INFO

# tighten logging on the DataNucleus Categories
DataNucleus.JDO.level=WARN 
# - All messages general to JDO
DataNucleus.JPA.level=WARN 
#  - All messages general to JPA
DataNucleus.Persistence.level=WARN 
#  - All messages relating to the persistence process
DataNucleus.Query.level=WARN 
#  - All messages relating to queries
DataNucleus.Lifecycle.level=WARN 
#  - All messages relating to object lifecycle changes
DataNucleus.Cache.level=WARN 
#  - All messages relating to the DataNucleus Cache
DataNucleus.ClassLoading.level=WARN 
#  - All exceptions relating to class loading issues
DataNucleus.MetaData.level=WARN 
#  - All messages relating to MetaData
DataNucleus.Management.level=WARN 
#  - All messages relating to Management
DataNucleus.General.level=WARN 
#  - All general operational messages
DataNucleus.Connection.level=WARN 
#  - All messages relating to Connections.
DataNucleus.JCA.level=WARN 
#  - All messages relating to Connector JCA.
DataNucleus.Transaction.level=WARN 
#  - All messages relating to transactions
DataNucleus.Plugin.level=WARN 
#  - All messages relating to DataNucleus plug-ins
DataNucleus.ValueGeneration.level=WARN 
#  - All messages relating to value generation
DataNucleus.Datastore.level=WARN 
#  - All general datastore messages
DataNucleus.Datastore.Schema.level=WARN 
#  - All schema related datastore log messages
DataNucleus.Datastore.Persist.level=WARN 
#  - All datastore persistence messages
DataNucleus.Datastore.Retrieve.level=WARN 
#  - All datastore retrieval messages
DataNucleus.Datastore.Native.level=WARN 
#  - Log of all 'native' statements sent to the datastore
DataNucleus.Enhancer.level=WARN 
#  - All messages from the DataNucleus Enhancer.
DataNucleus.SchemaTool.level=WARN 
#  - All messages from DataNucleus SchemaTool
DataNucleus.IDE.level=WARN 
#  - Messages from the DataNucleus IDE.

Sadly, now I am getting log messages such as:

2012-04-17 16:13:45.112
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints: Bundle "org.datanucleus.jpa" has an optional dependency to "org.datanucleus.enhancer" but it cannot be resolved

I 2012-04-17 16:13:45.115    
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints: Bundle "org.datanucleus" has an optional dependency to "org.eclipse.equinox.registry" but it cannot be resolved

I 2012-04-17 16:13:45.719
org.datanucleus.PersistenceConfiguration setProperty: Property datanucleus.rdbms.sql.allowAllSQLStatements unknown - will be ignored

I 2012-04-17 16:13:47.806
org.datanucleus.store.appengine.MetaDataValidator validate: Performing appengine-specific metadata validation for in.animeshpathak.nazdeeq.models.Note

Can someone please tell me how I can properly configure my logging.properties file? I need the general loglevel to INFO in order to see debug messages from my code at this moment, but want to set all DataNucleus loglevels to WARN.

Thanks.

1条回答
甜甜的少女心
2楼-- · 2019-06-28 05:09

Actually, if you want to see debug messages from your code you need FINEST level, not INFO.

Try replacing your logging.properties with this:

# Set the default logging level for all loggers to FINEST
.level=FINEST

# 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

Per DataNucleus's suggestion, this is much more concise:

# Set the default logging level for all loggers to FINEST
.level=FINEST

# Set the default logging level for ORM, specifically, to WARNING
DataNucleus.level=WARNING
查看更多
登录 后发表回答