在部署我的GAE應用程序之前,我在本地運行了數百個unit tests。我正在使用LocalServiceTestHelper來使用GAE服務,如memcache或數據存儲。在測試之間建立並拆除助手會創建大量的日誌輸出。如何在運行GAE/J測試用例時從LocalServiceTestHelper隱藏INFO消息?
如何重新配置java.util.logging以避免由LocalServiceTestHelper完全引起的INFO messages?
INFO: Local Datastore initialized:
Type: Master/Slave
Storage: In-memory
Feb 08, 2013 7:01:52 PM com.google.appengine.api.taskqueue.dev.LocalTaskQueue init
INFO: LocalTaskQueue is initialized
Feb 08, 2013 7:01:52 PM com.google.appengine.api.taskqueue.dev.LocalTaskQueue init
INFO: Automatic task execution is disabled.
Feb 08, 2013 7:01:52 PM org.quartz.simpl.SimpleThreadPool initialize
INFO: Job execution threads will use class loader of thread: main
Feb 08, 2013 7:01:52 PM org.quartz.core.QuartzScheduler <init>
INFO: Quartz Scheduler v.null.null.null created.
Feb 08, 2013 7:01:52 PM org.quartz.simpl.RAMJobStore initialize
INFO: RAMJobStore initialized.
Feb 08, 2013 7:01:52 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
Feb 08, 2013 7:01:52 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler version: null.null.null
Feb 08, 2013 7:01:52 PM com.google.appengine.api.taskqueue.dev.LocalTaskQueue start_
INFO: Local task queue initialized with base url http://localhost:8080
Feb 08, 2013 7:01:52 PM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
Feb 08, 2013 7:01:52 PM org.quartz.core.QuartzScheduler standby
INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
Feb 08, 2013 7:01:52 PM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.
編輯:
我創建文件src /測試/資源/ logging.properties。在測試執行之前,該文件被複制到target/test-classes /。它有以下內容:
com.google.appengine.api.taskqueue.dev.level=SEVERE
org.quartz.level=WARNING
但我仍然在運行測試時看到相同的日誌輸出。
謝謝!我用更多的信息更新了我的問題。我已經在src/test/resources中有這樣一個文件。但我仍然看到日誌輸出。任何想法是怎麼回事? – Ingo 2013-02-10 14:18:31
我仍然面臨這個問題。我的控制檯充滿了「Local Datastore initialized」消息,即使我有一個logging.properties文件unter src/test/resources。有什麼建議麼? – roemer 2015-04-03 08:34:05