How to Read from Syslog?

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.

1 Answer

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.

Your Answer

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

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.