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

Jens Kubieziel
  • 8,630
  • 5
  • 35
  • 116
pouya
  • 391
  • 2
  • 4
  • 12

3 Answers3

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

Felipe
  • 103
  • 4
pouya
  • 391
  • 2
  • 4
  • 12
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 .

Jens Kubieziel
  • 8,630
  • 5
  • 35
  • 116
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.

Steve
  • 3,152
  • 1
  • 8
  • 17
Mrpratik
  • 21
  • 1