Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 69310
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: m.ludwig [...] epages.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.30



Subject: Avoid running in POSIX::strftime issue on Windows
Date: Wed, 6 Jul 2011 09:55:24 +0000
To: "bug-sys-syslog [...] rt.cpan.org" <bug-sys-syslog [...] rt.cpan.org>
From: Michael Ludwig <m.ludwig [...] epages.com>
Download (untitled) / with headers
text/plain 1006b
It very much looks like POSIX::strftime() on Windows doesn't digest the %e format element, which denotes the day of month (without a zero prepended for single-digit days): perl5.14.1 -MPOSIX=strftime -lwe "print strftime q(%b %e %H:%M:%S), localtime" :: output with %e: %b %e %H:%M:%S So %e is similar to %d, which adds the leading zero for single-digit days, and has the benefit of being supported on Windows: perl5.14.1 -MPOSIX=strftime -lwe "print strftime q(%b %d %H:%M:%S), localtime" :: output with %d: Jul 06 11:45:54 Tested with ActiveState 5.10.1, 5.12.3 and 5.14.1, as well as with a home-compiled 5.12.3 on Windows. This leaves entries like this in syslog (rsyslog on a Linux host): Jul 5 19:39:16 192.168.56.1 %b %e %H:%M:%S syslog.pl[7336]: wichtige Durchsage Not fatal, but not nice either. With %d instead of %e, there is no such artefact. So maybe Sys::Syslog could be fixed to include the more portal %d format element? Patch against version 0.29 attached. Thanks, Michael Ludwig

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #69310] Avoid running in POSIX::strftime issue on Windows
Date: Tue, 14 Aug 2012 18:24:53 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 1.3k
Hello, Michael Ludwig wrot evia RT: Show quoted text
> It very much looks like POSIX::strftime() on Windows doesn't digest the %e format element, which denotes the day of month (without a zero prepended for single-digit days): > > perl5.14.1 -MPOSIX=strftime -lwe "print strftime q(%b %e %H:%M:%S), localtime" > :: output with %e: %b %e %H:%M:%S > > So %e is similar to %d, which adds the leading zero for single-digit days, and has the benefit of being supported on Windows: > > perl5.14.1 -MPOSIX=strftime -lwe "print strftime q(%b %d %H:%M:%S), localtime" > :: output with %d: Jul 06 11:45:54 > > Tested with ActiveState 5.10.1, 5.12.3 and 5.14.1, as well as with a home-compiled 5.12.3 on Windows. > This leaves entries like this in syslog (rsyslog on a Linux host): > > Jul 5 19:39:16 192.168.56.1 %b %e %H:%M:%S syslog.pl[7336]: wichtige Durchsage
I guess the reason this was not detected earlier is that we assumed people on Win32 would send the messages to the local EventLog, and didn't check the case where they would send them to a remote syslog server. Show quoted text
> Not fatal, but not nice either. With %d instead of %e, there is no such artefact. So maybe Sys::Syslog could be fixed to include the more portal %d format element? Patch against version 0.29 attached.
Thanks, your patch is applied and will be included in Sys::Syslog version 0.30. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.