在2.12版中禁用spymemcached日志记录

时间:2017-04-11 18:37:00

标签: logging couchbase spymemcached

我们最近对spymemcached库进行了版本更改 特别是从版本2.9.12.12.1

似乎更改每秒都会生成一条日志消息,如下所示:

2017-04-11 17:20:13,668 Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211} DEBUG [n.s.m.p.a.AsciiMemcachedNodeImpl:72] log | Selecting with delay of 1000ms
2017-04-11 17:20:14,668 Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211} DEBUG [n.s.m.p.a.AsciiMemcachedNodeImpl:72] log | Done dealing with queue.
2017-04-11 17:20:14,668 Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211} DEBUG [n.s.m.p.a.AsciiMemcachedNodeImpl:72] log | Selecting with delay of 1000ms
2017-04-11 17:20:15,669 Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211} DEBUG [n.s.m.p.a.AsciiMemcachedNodeImpl:72] log | Done dealing with queue.

我在AsciiMemcachedNodeImpl类的代码中看到的是:

71    getLogger().debug("Set up %s with %s keys and %s callbacks", this,
72        pcb.numKeys(), pcb.numCallbacks());

我想应该有办法配置spymemcached日志记录 它是在运行时通过代码。
有谁知道如何摆脱这些日志?

注意This question有答案,但根据其日期,似乎版本为<= 2.9.1,因为net.spy.log包和LoggerImpl班级不再存在。我在整个setLevel源代码中也找不到任何spymemcached函数。

1 个答案:

答案 0 :(得分:0)

好吧,我终于解决了这个问题:

<logger name="net.spy.memcached.protocol.ascii" level="info"/>

logback.xml处理文件。