[BusyBox] logger & syslogd: should they agree about date formats?

Joel Buckley leojmail at yahoo.com
Thu Apr 3 06:18:04 UTC 2003


Brodie,

Thanks for the research.  

My main point:
- Consistent is Good.
- Internationalized and Localized MAY Be Better...


Reason for Consideration      ctime()     strftime()
============================  ==========  ==========

vvvvv OLD EXPECTATION vvvvv
"All SysAdmins Read English"  1st Choice  2nd Choice
"Not All Users Read English"  2nd Choice  1st Choice
^^^^^ NEW EXPECTATION ^^^^^
Therefore, who is the audiance?

vv Performance vs. Feature vv 
"Performance is Critical"     1st Choice  2nd Choice
"Feature is Paramount"        2nd Choice  1st Choice
Realtime Systems, Servers, and Some PDAs fall in the 
first class.
Most Home PCs and Some PDAs fall in the second class.
Work PCs and Workstations are in both sides...

Which LIBC are You Targetting?
glibc (Full Blown Systems)    2nd Choice  1st Choice
uClibc (Embedded Systems)     1st Choice  2nd Choice
(Based on your information.... ^^^^^^^^^^^^^^^^^^^^^)
GNU systems are by nature, feature rich targeted.
uClibc systems are by nature, performance&size
targeted
============================  ==========  ==========


The trouble comes in that "busybox" is slightly
tainted 
toward the uClibc direction, but can easily be
utilized 
on a GNU system.

Also, syslog's circular queueing leads to some
optimizations to allow for increased syslog message
handling in highly utilized and/or under CPU powered
systems.

Further, syslog's messages are generated "elsewhere".
That "elsewhere" includes other applications that may
have already Internationalized and Localized the 
message(s)... Lots of inputs, only one syslog...


I would vote for consistent - across "The System".
Note, "The System" may be bigger than a single 
computer when you consider remote syslog management...

If "The System" can handle it and your customers are
expected to understand the messages, then utilizing
the Internationalized and Localized messages would
be appropriate.

Just keep in mind who and what your messages will be
sent to and thru :)

Cheers,
leoj. 




--- Stewart Brodie <stewart.brodie at pace.co.uk> wrote:
> (comments refer to the unstable repository in CVS,
> latest as of the date of
> this message)
> 
> I am seeing various messages in the
> syslogd-generated log which contain two
> dates, for example:
> 
> Jan  1 00:00:16 136 user.notice  1<0xe6><0x9c><0x88>
>  1 00:00:16 message ...
> 
> The problem here is that the date specification
> generated by logger has been
> generated in Chinese using a UTF-8 encoding (month
> name shown in hex in the
> string above), which syslogd then fails to recognise
> as a date (because it
> doesn't match the strict tests in
> syslogd.c:logMessage) and hence generates
> its own timestamp.
> 
> There are several things happening here and I'm not
> sure if any of them are
> bugs, to be honest, but would like opinions on which
> behaviour is correct.
> 
> Firstly, syslogd is testing the message string using
> a hardwired idea of what
> a date looks like.  (One possible way around this
> would be for it to use
> strftime to generate the current date and then
> compare it against the start
> of the message - although that gives it a tiny
> loophole at day rollovers :-)
> 
> Secondly, syslogd uses ctime and not strftime to
> generate the time string. 
> ctime always produces English output, regardless of
> locale.  strftime will
> use the correct locale, but only if syslogd does
> 'setlocale(LC_TIME, "")'
> before calling strftime.
> 
> Thirdly, logger is at the mercy of the C library as
> to the format of the
> timestamp that the syslog() generates.  glibc uses
> strftime; uClibc uses
> ctime.
> 
> I suppose the question is does this matter?  It's
> just rather ugly that the
> log file has half the messages with two dates in
> depending on whether or not
> the calling process has called setlocale(LC_TIME,
> "") or not.
> 
> -- 
> Stewart Brodie, Senior Software Engineer
> Pace Micro Technology PLC
> 645 Newmarket Road
> Cambridge, CB5 8PB, United Kingdom         WWW:
> http://www.pacemicro.com/
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/mailman/listinfo/busybox


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com


More information about the busybox mailing list