I've just noticed in source file webalizer.c :

   /* month names used for parsing logfile (shouldn't be lang specific)
*/
   char *log_month[12]={ "jan", "feb", "mar", "apr", "may", "jun",
"jul", "aug", "sep",  "oct", "nov", "dec"};



and I realized in Italian it's ok for FEB, MAR, APR but NOT for MAY!!!

In fact, from error messages I get

Errore: Tralascio il record (data errata): [21/lug/2015:07:35:56 -0000]
[1]
Errore: Tralascio il record (data errata): [21/lug/2015:07:35:56 -0000]
[2]
Errore: Tralascio il record (data errata): [21/lug/2015:07:35:56 -0000]
[3]
Errore: Tralascio il record (data errata): [21/lug/2015:07:35:56 -0000]
[4]
Errore: Tralascio il record (data errata): [21/lug/2015:07:35:56 -0000]
[5]


can you see 'lug' instead of 'jul'....


So I think it can be an explanation for what I get now...

For Italy we should have: 


   char *log_month[12]={ "gen", "feb", "mar", "apr", "mag", "giu",
"lug", "ago", "set",  "ott", "nov", "dic"};


but this can be a solution only for Italy and not for any other country
with a specific language other than english....


So:

1. Is it possible to chain the char *log_month[12]=... definition with
an external, locale-dependant, array?

or

2. is it possible to use another date-conversion function to get a
human-readable format from a unix timestamp ? (I remember... it's coming
from a standard squid log file)

Now, in parse.c i see:

   /* format date/time field */
   strftime(log_rec.datetime,sizeof(log_rec.datetime), "[%d/%b/%Y:%H:%M:
%S -0000]",localtime(&i));

and, as we can see form the man page, 

http://man7.org/linux/man-pages/man3/strftime.3.html

 %b     The abbreviated month name according to the current locale.


Do You think we can found a workaround for this?

Why don't use

%m     The month as a decimal number (range 01 to 12)

?

Thanx for the collaboration
Luca







Reply via email to