SPUG: /var/log/messages

Colin Meyer cmeyer at helvella.org
Thu May 30 18:06:14 CDT 2002


Hi Mike,

On Thu, May 30, 2002 at 02:59:43PM -0700, Mikel Tidwell wrote:
> Hello,
> 
> I have a project where I want to write to /var/log/messages.  From what
> I've read, this is not a recommended approach, but we already have software
> monitoring messages for critical messages, and I'd like to use this system
> already in place to flag a critical failure (not not normally logged).

Remember me? ;-)

/var/log/messages and several other files in that directory belong to
syslogd. Check the manpages for syslogd and syslog.conf. You most
definitely should not be writing to this file directly. A given machine
may have syslog configured to log to another location, perhaps even on
a remote machine.

There is a (POSIX?) C api for emitting syslog messages.  There is a Perl
module, part of the standard distro, for doing this from Perl programs.
See: perldoc Sys::Syslog

[ as an aside, does anyone know how win32 systems do syslog? From my
limited experience with nt4, I know that it has some sort of equivelant
logging system. ]

There's another module on the CPAN called Unix::Syslog that claims to
be more feature rich than Sys::Syslog.

Have fun,
-C.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list