0

I am trying to log tor with the following command:

journalctl -f -u tor@default.service | echo < log.tor.txt

Is there anything that I should change? Is this possible with journalctl? should I see something else?

2 Answers 2

0

It seems like redirecting the output of journalctl is a bit tricky, see this post for more context

You may want to use

sudo journalctl > complete.log.txt

Depending on your needs you can use journalctl -f instead

Then you can filter the results with

cat complete.log.txt | grep tor

See also https://unix.stackexchange.com/a/360793/440770

3
  • The file will remain blank. The logs that will normally show up do not show up. In turn, nothing will happen. BTW, that command will not work. I tried restarting tor, and the file still showed me nothing. Jan 4, 2021 at 22:41
  • It seems like redirecting the output of journalctl is a bit tricky, I updated my answer
    – roneo.org
    Jan 5, 2021 at 7:16
  • SystemD - a journalctl is a part of it's suite - has a great API for accessing and doing logs, so your task can be solved even without a file redirection! Keep in mind that the size and the depth of journals are configurable ;)
    – Alexey Vesnin
    Oct 3, 2021 at 17:11
0

Well, the best and the right way is to use Tor as a SystemD service - don't forget to build it by hand with this features enabled! It's totally not the problem - SystemD offers a service groups nowdays and you can use them to tailor all your specific needs without discarding runtime dependencies and starting/stopping grouping and order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.