13

On my linux i can run sudo journalctl -u tor@default to see tor log. where is the log file stored on the system. Maybe a unix.stakexchange kind of question but i opt to ask it here

2
  • Which distribution are you using?
    – Jens Kubieziel
    Sep 12, 2018 at 11:32
  • @JensKubieziel kali-rolling
    – pouya
    Sep 12, 2018 at 11:42

3 Answers 3

11

By default stdout and stderr of a systemd unit are sent to syslog. On my machine(Kali distro) it is stored in /var/log/syslog. So to see tor unit output run

cat /var/log/syslog | grep tor -i

Or to keep following the log:

tail -F /var/log/syslog | grep tor -i

maybe you need a sudo:

sudo tail -F /var/log/syslog | grep tor -i

Edit

In case someone needs to monitor tor unit i found a better way. Adding -f or --follow flag to journalctl makes it to continuously print new entries as they are appended to the journal. You can then pipe it to a parser and react based on it.

In one of your termianl tabs run

sudo journalctl -f -u tor@default | grep bootstrapped -i

in another tab do

sudo systemctl restart tor

You will see the results are appended to the first terminal as they are appended to the systemd journal

4

Usually Tor stores its log files in /var/log/tor. Depending from the specific settings you'll find /var/log/tor/notices.log, /var/log/tor/log, /var/log/tor/info.log, etc.

The option Log in torrc specifies where the log file is stored and what kind of information is logged. So if you don't find the above mentioned files please have a look into your configuration.

An example entry could look like

Log info file /tmp/foo/bar.log

This would write a log file with info messages to /tmp/foo/bar.log .

2
  • 1
    Nothing exists in /var/log/tor and all options related to logging is commented out in my /etc/tor/torrc file. Still journalctl manages to show me tor logs. I guess it is related to how tor service is configured on the system than the tor configuration itself.
    – pouya
    Sep 12, 2018 at 7:51
  • please mention the proper torrc logging synt@x? When i uncommented tor failed to start
    – 16851556
    Apr 4, 2021 at 9:11
2

Usually Tor stores its log files in /var/log/tor. Depending from the specific settings you'll find /var/log/tor/notices.log, /var/log/tor/log, /var/log/tor/info.log, etc. The option Log in torrc specifies where the log file is stored and what kind of information is logged. So if you don't find the above mentioned files please have a look into your configuration.

1
  • Usually Tor stores its log files in /var/log/tor. Depending from the specific settings you'll find /var/log/tor/notices.log, /var/log/tor/log, /var/log/tor/info.log, etc. The option Log in torrc specifies where the log file is stored and what kind of information is logged. So if you don't find the above mentioned files please have a look into your configuration.
    – Mrpratik
    Aug 22, 2020 at 7:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .