在Play框架2中关闭MemCachedClient日志记录

时间:2014-06-12 06:12:08

标签: java playframework spymemcached

我在play框架2中使用了MemCachedClient,我得到了这样的INFO消息:

2014-06-12 11:37:45.513 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2014-06-12 11:37:45.516 INFO net.spy.memcached.MemcachedConnection:  Connection state changed for sun.nio.ch.SelectionKeyImpl@1ab07e8

我想把它们关掉。我怎样才能在Play框架2中实现它

2 个答案:

答案 0 :(得分:1)

在创建MemcachedClient对象之前添加以下代码行对我来说很有用。

System.setProperty("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.SunLogger");
Logger.getLogger("net.spy.memcached").setLevel(Level.WARNING);

答案 1 :(得分:0)

您应该可以在logger.net.spy.memcached=OFF中设置application.conf。或者可能只是将其提升到更高的值WARNERROR

来源:Play - SettingsLogger