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

Query logs #409

Open
marcelloinfoweb opened this issue Aug 31, 2024 · 8 comments
Open

Query logs #409

marcelloinfoweb opened this issue Aug 31, 2024 · 8 comments

Comments

@marcelloinfoweb
Copy link

How is it possible to show a log of requests in the terminal in real time?

@folbricht
Copy link
Owner

I wanted to add this at some point anyway. Would you be able to try out the issue-409 branch? See #410 for an example.

@cbuijs
Copy link
Contributor

cbuijs commented Sep 1, 2024

You can already do so with the syslog stuff?

@folbricht
Copy link
Owner

True, it's been a while and I completely forgot about that, doh. The new one is a bit easier to use but this does look unnecessary. Should probably keep just syslog for logging and not merge #410

@cbuijs
Copy link
Contributor

cbuijs commented Sep 1, 2024

No worries. There is a case for both anyway ;-).

With file logging you night want some pruning options as well to limit size of the logging files etc

@folbricht
Copy link
Owner

folbricht commented Sep 1, 2024

That won't work for you unless you can compile it from the branch. If you can't compile it, you could try out syslog instead.
There's an example in https://github.com/folbricht/routedns/blob/master/cmd/routedns/example-config/syslog.toml

@marcelloinfoweb
Copy link
Author

That won't work for you unless you can compile it from the branch. If you can't compile it, you could try out syslog instead. There's an example in https://github.com/folbricht/routedns/blob/master/cmd/routedns/example-config/syslog.toml

I did it, I compiled the branch and now I have a log, but it doesn't show the blocked and/or released lists.

@folbricht
Copy link
Owner

syslog does log responses as well if that's what you're looking for.

@cbuijs
Copy link
Contributor

cbuijs commented Sep 2, 2024

If you want to log the blocks/allows. You need to start with -l5 or -l6 as parameter.

I start RouteDNS as follows and have all the logging in a file (routedns.log):
./routedns -l6 routedns.toml >> routedns.log 2>&1 & disown

Or get everything into syslog using logger:
./routedns -l6 routedns.toml 2>&1 | /usr/bin/gawk '{print substr($0, index($0, $3))}' | /usr/bin/logger -t "ROUTEDNS" & disown

You can play with the log levels to get more/less logging. I think from -l5 on, blocking is logged.

Above examples make RouteDNS run in the background and it stays there running when you log off.

P.S. You might need to play with the index in the gawk command, I used it to cut off the date/time as syslog already adds it.

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