spymemcached - 是否可以禁用日志系统?
我们正在使用spymemcached memcached客户端,但我们没有发现如何禁用日志系统。
我们如何在运行时将当前日志系统更改为 log4j 或 sl4j 之类的系统?
注意:我们可以传递一些虚拟机参数,但问题是:我们无法更改服务器配置。是否可以在运行时传递这些虚拟机参数?如果可以的话,我们怎样才能做到这一点呢?
we are using the spymemcached memcached client but we didn't discovered how we could disable the logging system.
How could we at runtime change the current logging system to something like log4j or sl4j?
Notice: We could pass some VM arguments, but the problem is: we can't change our server configuration. Is it possible to pass these VM arguments at runtime? If possible, how could we do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在创建
MemcachedClient
对象之前,我通过执行此操作停止了对catalina.out
的过多 Tomcat 日志记录:I stopped excessive Tomcat logging to
catalina.out
by doing this before creating theMemcachedClient
object:我知道这是一个老问题,这个解决方案在运行时不起作用,但我遇到了类似的问题,只找到了这个问题。您可以找到一种通过 tomcat 配置文件设置spymemcached 日志记录级别的方法 这里。
重要部分:
简短总结如何使spymemcached更加安静:
将以下内容添加到
$CATALINA_HOME/bin/catalina.sh
:将此添加到
$CATALINA_HOME/conf/logging.properties
:(可以使用 SEVERE、WARNING、INFO、CONFIG、FINE 设置处理程序的日志级别阈值, FINER、FINEST 或 ALL)
仅使 MemcachedConnection 更简洁:
I know it's an old question and this solution will not work at runtime, but I had a similar problem and only found this question. You can find a way to set spymemcached logging level via tomcat config files here.
Important part:
A short summary how you can make spymemcached more silent:
Add the following to
$CATALINA_HOME/bin/catalina.sh
:Add this to
$CATALINA_HOME/conf/logging.properties
:(A handler's log level threshold can be set using SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL)
To make only the MemcachedConnection less verbose: