microsocks icon indicating copy to clipboard operation
microsocks copied to clipboard

Parameter -q (quiet) to disable logging

Open webaddicto opened this issue 3 years ago • 1 comments

I am using microsocks and it works perfectly, so very good job!

I have just one question:

Can we disable the logging, such as:

client[4] 123.123.123.123: connected to www.yahoo.com:443

Would be useful a parameter like -q (quiet) or -nolog or similar.

I found the logging code in sockssrv.c:

	if(CONFIG_LOG) {
		char clientname[256];
		af = SOCKADDR_UNION_AF(&client->addr);
		void *ipdata = SOCKADDR_UNION_ADDRESS(&client->addr);
		inet_ntop(af, ipdata, clientname, sizeof clientname);
		dolog("client[%d] %s: connected to %s:%d\n", client->fd, clientname, namebuf, port);
	}

webaddicto avatar Sep 23 '21 11:09 webaddicto

yeah, you can compile microsocks like this:

CPPFLAGS=-DCONFIG_LOG=0 make

which disables the logging. this is then hardcoded into the binary though. you could compile one with logging on and one with logging off and give them different names, e.g. microsocks-silent for the one with logging off.

rofl0r avatar Sep 23 '21 17:09 rofl0r

@rofl0r Any chance we could make this configurable at runtime? IMO hardcoding config shouldn't be the default because then we would have to deviate from the distributor's version.

Also I'd like an option to just disable the connection logging while keeping everything else.

TheDcoder avatar Sep 17 '22 22:09 TheDcoder