[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: syslog on Lenny



Boyd Stephen Smith Jr. wrote:
> On Thursday 14 January 2010 07:27:22 Roman Gelfand wrote:
>> I am running a service which generates logs.  What do I need to do to
>> haave these log entries also appear in syslog?
> 
> That's not how syslog works.  There's isn't a process that goes through and 
> gathers logs from various services and glues them together into a unified 
> syslog.
> 
> Instead there's a unified syslog service (C system call) that multiple 
> applications can use.  Each time a log is made it is tagged with a "facility" 
> and "level".
> 
> Then your syslog daemon receives all these logs.  It writes most of them out 
> to syslog, but it can also differentiate based on facility, level, and content 
> of the log message.
> 
>> BTW.. I modified /etc/rsyslog.conf file adding 'abcf.*
>> -/var/log/abc.log' line.  This didn't make a difference.
> 
> This would mean that anything logged using the syslog interface (C language 
> call) that started with abcf.* would be written to /var/log/abc.log by your 
> syslog daemon.  It does not causes the syslog daemon to pull messages out of 
> /var/log/abc.log, add the "abcf" prefix and append them to /var/log/syslog.
> 
> If you want the syslog daemon to see the messages logged by a program, that 
> program has to support using syslog and you have to configure it to write to 
> syslog (generally by specifying a facility and, optionally, a prefix), 
> possibly in addition to other logging.  Then, if you want the messages to 
> appear somewhere in addition to / instead of /var/log/syslog, you configure 
> your syslog daemon by filtering on the facility/level/content.

Thanks Boyd for the nice explanation.

I just want to add, that rsyslog actually has the ability to pull messages out
of an arbitrary file (although I wouldn't use this mechanism on a syslog log
file). See http://www.rsyslog.com/doc-imfile.html for further info

Cheers,
Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: