[ic] Catalog error.log timestamp format?

Peter peter at pajamian.dhs.org
Wed Jan 23 23:15:50 UTC 2013


On 24/01/13 05:18, Mike Heins wrote:
> Quoting IC (ic at tvcables.co.uk):
>> Hi Folks,
>>
>> Where is the catalog error.log timestamp defined, I need to change the
>> format so it only shows the first 3 letters of the month, eg Jan rather than
>> January
> 
> Right now it isn't configurable, it is set to the HTTP common logtime
> format. However, you could modify lib/Vend/Util.pm and make the
> logtime() routine configurable:
> 
> # Returns time in HTTP common log format
> sub logtime {
>     return POSIX::strftime($::Variable->{MV_LOGTIME_FORMAT} || "[%d/%B/%Y:%H:%M:%S %z]", localtime());
> }
> 
> Then in catalog.cfg:
> 
>     Variable MV_LOGTIME_FORMAT [%d/%b/%Y:%H:%M:%S %z]

Better yet, override the sub from Interchange.cfg, then your custom sub
won't get overwritten when you upgrade Interchange:

GlobalSub <<EOR
sub override_me {
        package Vend::Util;
        sub logtime {
                return POSIX::strftime($::Variable->{MV_LOGTIME_FORMAT}
|| "[%d/%B/%Y:%H:%M:%S %z]", localtime());
        }
}
EOR


Peter



More information about the interchange-users mailing list