Tech Journal Back to Tech Journal

How can I get socks5 daemon to stop logging all the connections, but still log errors?

Well, the debug command-line options don't give that as an option. So what to do? Hack the source code!
Change the logging facility to something like LOG_LOCAL2. Just find the #define or #undefine for SYSLOG_FAC in acconfig.h (or in include/config.h after running ./configure). Change it to be like:

#define SYSLOG_FAC LOG_LOCAL2

Finally, recompile the executable and install it. Now, the socks5 daemon is logging as "LOCAL2". You can now configure syslog to direct those messages to /dev/null or some other location. For example, to log to /var/log/socks5 put the following line in:

local2.* /var/log/socks5

in your /etc/syslog.conf. But this is not enough. It'll still log to /var/log/messages. Find the line that logs to it, and add ;local2.none to the first column/word to prevent it from logging to /var/log/messages as well.

Last updated on 2004-10-15 15:00:00 -0700, by Shalom Craimer

Back to Tech Journal