From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/518 Path: main.gmane.org!not-for-mail From: Charlie Brady Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: syslog from perl but no date (svlogd) Date: Thu, 15 Jul 2004 19:06:17 -0400 (EDT) Message-ID: References: <20040715222109.GE7203@digitus> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8BIT X-Trace: sea.gmane.org 1089932791 30607 80.91.224.253 (15 Jul 2004 23:06:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2004 23:06:31 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-756-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Jul 16 01:06:23 2004 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1BlFJ0-0005Cq-00 for ; Fri, 16 Jul 2004 01:06:22 +0200 Original-Received: (qmail 10113 invoked by uid 76); 15 Jul 2004 23:06:43 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 10107 invoked from network); 15 Jul 2004 23:06:43 -0000 X-X-Sender: charlieb@e-smith.charlieb.ott.istop.com Original-To: Csillag=?iso-8859-2?Q?Tam=E1s?= In-Reply-To: <20040715222109.GE7203@digitus> Xref: main.gmane.org gmane.comp.sysutils.supervision.general:518 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:518 On Fri, 16 Jul 2004, Csillag[iso-8859-2] Tamás wrote: > The only problem I came across, is a date logging issue. > Let me explain: (I use socklog configuration created by socklog-conf) > If I run > # echo test | logger > The following line appears in the logs > user.notice: Jul 15 23:52:52 logger: test > > But if I run the following perl script: > > #!/usr/bin/perl > > use Sys::Syslog qw(:DEFAULT setlogsock); ... > The line is the following: > mail.info: example.pl[3449]: test > > The problem is that the latter lack's the time/date information. > Most program works as expected but the perl based not. > > I know that I can add a -t (or -tt) option to svlogd but it will add > time information to *all* lines AFAIK. > > I do not know if this is a perl bug and syslogd works around the > problem, but it works right with it. This is a problem with the syslog protocol. As you can see in http://www.faqs.org/rfcs/rfc3164.html, the content of syslog messages is ill-defined - essentially anything goes. Moreover, the recommended TIMESTAMP format is in localtime, which as we've recently discussed here is ambiguous. I'd recommend that you use -t or -tt in svlogd, and ignore any timestamp which was supplied by the logging client. I guarantee you'll be less confused taht way. --- Charlie