5

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 '18 at 11:32
  • @JensKubieziel kali-rolling
    – pouya
    Sep 12 '18 at 11:42
3

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
  • 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 '18 at 7:51
  • please mention the proper torrc logging synt@x? When i uncommented tor failed to start
    – 16851556
    Apr 4 at 9:11
1

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

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

0

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 '20 at 7:06

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.