Use Syslog on Linux.
If you need to be cute checkout
this legacy page
and note the lack of support