LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Logging to /var/log/messages (https://www.linuxquestions.org/questions/programming-9/logging-to-var-log-messages-393730/)

paddyjoy 12-16-2005 08:01 PM

Logging to /var/log/messages
 
Is there a program that controls what goes into /var/log/messages or do individual programs just append directly to the file?

Paddy

mebrelith 12-16-2005 08:30 PM

Syslog is the culprit.

paddyjoy 12-17-2005 02:18 AM

Thanks I'll have a look into the man pages.

Paddy

bigearsbilly 12-19-2005 05:52 AM

man syslogd
logger is what you want maybe.
Can run at command line.
man page

bigearsbilly 12-19-2005 05:58 AM

Code:

logger -p user.alert WHAT

billym.primadtpdev>dmesg
Dec 19 11:46:42 primadtpdev billym: [ID 702911 user.alert] hello
Dec 19 11:54:09 primadtpdev billym: [ID 702911 user.alert] WHAT


bigearsbilly 12-19-2005 06:01 AM

Can do this on my system: (prints to all terminals)
Code:

billym.primadtpdev>logger -p user.emerg WHAT
billym.primadtpdev>
Message from syslogd@primadtpdev at Mon Dec 19 11:56:48 2005 ...
primadtpdev billym: [ID 702911 user.emerg] WHAT

look in syslog.conf for details.


All times are GMT -5. The time now is 06:29 PM.