[ale] Localization issues

Chris Fowler cfowler at outpostsentinel.com
Mon Jan 27 18:52:24 EST 2014


I'm working on some localization issues for a customer.  Typically my 
device localizes in 'C'.   My code has been hard-coded to convert epochs 
to local time in the format of 'DD-MM HH:MM:SS'.   I've made some 
changes on the 'C' and Perl side to read a configuration argument from 
the XML config that formats the time via strftime(3) than the hard coded 
method.  I went with this because it allows more variability than 
forcing people to enter formats in config like 'YYYY-MM-DD'.  The only 
downside is that they have to enter it like a format string.  No 
problem, tweak documentation.

My question revolves around a few places where time is created.

Case 1: date

*[root at cs-buford]# date
Mon Jan 27 23:39:21 UTC 2014*

If the date is spelled out I do not think that will be a problem.

*Case 2: syslog-ng

Jan 27 23:38:30 cs-buford kernel: kjournald starting.  Commit interval 5 
seconds
Jan 27 23:38:32 cs-buford kernel: kjournald starting.  Commit interval 5 
seconds*

Again, it is spelled out so I do not think it is going to be a problem.

This started when on our web app we displayed time as MM/DD/YY and it 
confused my customer visiting from Africa.  I have the Java programmers 
working on that locale issue and it has been hard. They work from India 
so they do not provide me input.  They do _exactly_ as I say even if I'm 
full of it. :P

I've been googling syslog-ng date and I can not really see a method to 
change the format from the standard BSD format to one I specifiy in 
syslog.conf.  Is this even possible?

On date, it is doing exactly as it is supposed to so I am not concerned 
with it.   I just need to locate any perl code tham may be using `date` 
(from shell exec) or POSIX::cmtime() and see if I need to address those.

This is an "embedded" system so locales do not really exist.  Time zones 
are limited to a few files in /var/share/zoneinfo so anything outside of 
those must be old skool UTC.   This has not been a problem because of 
the hundreds I've deployed I've set them all the UTC.

There are very few OSS programs that write to their own log vs use 
syslog.  I think there is one.  For that I can store the format in 
/etc/date.fmt and modify the OSS program to read from that.  That will 
keep the OSS out of my library and I can simply comment mark the changes 
vs non-changes like I normally would.

Does anyone know if it is possible to specify a format for syslog-ng 
other than the BSD standard one?

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20140127/0ff9f1ea/attachment.html>


More information about the Ale mailing list