Add Logfile to Memcache/Memcached Daemon on Linux
If you need to add a log file for memcache
to help debug an issue, you can either use the following syntax:
memcached -d -m 3072 -l localhost -p 11211 -u nobody -v 2>>/tmp/memcached.log
or if you’re on RHEL/CentOS, you can edit the file /etc/sysconfig/memcached
like so:
PORT="11211"
USER="memcached"
MAXCONN="3048"
CACHESIZE="256"
OPTIONS="-vv >> /var/log/memcached 2>&1"
Save the file, restart memcache and you’ll have a log file. This was taken from this StackOverflow question.