I m using syslog in myprograme to generate log messages.
Is there a way to send the syslog output of my program to stdout ?
I do not want to use the tail
command to see my program log, I would like to see it directly on the console
I m using syslog in myprograme to generate log messages.
Is there a way to send the syslog output of my program to stdout ?
I do not want to use the tail
command to see my program log, I would like to see it directly on the console
You'll want to edit your /etc/syslog.conf
file.
depending on exactly what facility you're sending to syslogd, you'll need to add a line something like this:
<facility>.debug /dev/console
be sure to check out man 5 syslog.conf
for all the details..
To continuously clone file output to a console/shell use the following command in that console/shell:
tail -f <logfile> &
-f
makes tail continue printing whatever gets written to the file
&
puts the process in the background so you can do other stuff in the window. Omit the &
if you want the console to block until you press ctrl+c
.