How to read from syslog?

I can write to syslog via:

logger "foo bar baz"

but how do I read from syslog? my only guess is:

tail -f /var/log/syslog

but that doesn't seem right from my testing.

Note: also looking for a way to delete/drain all syslog logs/messages.


Solution 1:

tail -f shows what happens after it is run, so you need to start that command before issuing the logger command.

Syslog is just a text file. so you can read it with anything that handles those - less is often used. (You can also grep or otherwise manipulate its output to look for certain things)

It is possible that the logging us not going to syslog - look at /var/log/messages, and if that does not work look at /etc/rsyslog* to track where logging is going.