Spymemcached - can I turn off the registration system?

we are using a spymemcached memcached client, but we have not found how we can disable the logging system.

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

Note. We can pass some arguments to the VM, but the problem is that we cannot change the server configuration. Can these arguments be passed to VM at runtime? If possible, how can we do this?

+2


source to share


2 answers


I stopped the excessive Tomcat logging before catalina.out

by doing this before creating the object MemcachedClient

:



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

      

+7


source


I know this is an old question and this solution won't work at runtime, but I had a similar problem and found this question. You can find a way to set the spymemcached logging level via tomcat config files here .

An important part:

A short summary of how you can make spymemcached quieter:

Add in the $CATALINA_HOME/bin/catalina.sh

following:

CATALINA_OPTS="-Dnet.spy.log.LoggerImpl=net.spy.memcached.compat.log.SunLogger"

      



Add this to $CATALINA_HOME/conf/logging.properties

:

(The handler log level threshold can be set using SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, or ALL)

net.spy.memcached.level = WARNING

      

To make the MemcachedConnection only less verbose:

net.spy.memcached.MemcachedConnection.level = WARNING

      

+1


source







All Articles