是否可以禁用日志记录系统

是否可以禁用日志记录系统

本文介绍了spymemcached-是否可以禁用日志记录系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用spymemcached memcached客户端,但是我们没有发现如何禁用日志记录系统.

we are using the spymemcached memcached client but we didn't discovered how we could disable the logging system.

我们如何在运行时将当前的日志记录系统更改为log4j或sl4j之类的内容?

How could we at runtime change the current logging system to something like log4j or sl4j?

注意:我们可以传递一些VM参数,但是问题是:我们无法更改服务器配置.是否可以在运行时传递这些VM参数?如果可能的话,我们该怎么做?

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?

推荐答案

在创建MemcachedClient对象之前,我通过这样做停止了过多的Tomcat登录到catalina.out:

I stopped excessive Tomcat logging to catalina.out by doing this before creating the MemcachedClient object:

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

这篇关于spymemcached-是否可以禁用日志记录系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 18:29