[Omaha.pm] How can I log to metalog from Perl?

Jay Hannah jhannah at omnihotels.com
Wed Sep 15 13:24:35 CDT 2004


Hola --

I'm trying to log to metalog from Perl w/o forking a call to "logger". (I'm worried about performance since my app will be high volume).

I use this program:

-----------------------------------------
#!/usr/bin/perl
use Sys::Syslog qw(:DEFAULT setlogsock);

setlogsock("unix");
openlog("ProgramX", 'ndelay', 'user');
syslog('notice', 'Test 1');
syslog('notice', 'What?: Test 2');
closelog;
-----------------------------------------

And, in a syslogd log, I see this:

Sep 15 10:34:25 king ProgramX: Test 1
Sep 15 10:34:25 king ProgramX: What?: Test 2

Which is great. In a metalog log, I see this:

ProgramX: [What?] Test 2_

Questions:
1) Where did the datetime stamp go? I can't figure out how to get a stamp in metalog from Perl.
2) Why do I have to have a colon in the message or no log occurs?
3) What's the _ at the end of the log entry that did work?
4) Should I be using something other than Sys::Syslog? I can't find any metalog stuff in CPAN or metalog anywhere?

And, on a different note:
Is network logging likely to happen anytime soon? 
http://sourceforge.net/tracker/index.php?func=detail&aid=563753&group_id=30635&atid=399905

Thanks!

Jay Hannah
Director of Development
Omni Hotels Reservation Center
Tel: (402) 952-6573
Mobile: (402) 578-3976
Email: jhannah at omnihotels.com

The Omni Majestic -- a unique boutique concept -- takes you back in time with concierge style service in the heart of St. Louis.  Learn more at www.omnimajestic.com.




More information about the Omaha-pm mailing list