Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter -q (quiet) to disable logging #43

Closed
webaddicto opened this issue Sep 23, 2021 · 2 comments
Closed

Parameter -q (quiet) to disable logging #43

webaddicto opened this issue Sep 23, 2021 · 2 comments

Comments

@webaddicto
Copy link

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);
	}
@rofl0r
Copy link
Owner

rofl0r commented Sep 23, 2021

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.

@TheDcoder
Copy link

@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.

@rofl0r rofl0r closed this as completed in 655c53d Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants