[Dancer-users] UTC timestamp for logger_format
David Precious
davidp at preshweb.co.uk
Sun Apr 8 16:32:54 CEST 2012
On Sat, 7 Apr 2012 21:30:19 +0100
Alex C <calyx238 at gmail.com> wrote:
> I noticed that Dancer gets its timestamps using localtime(). I prefer
> to have all my logs in UTC.
>
> Please can I suggest the following patch to Dancer::Logger::Abstract
> to provide an option for this?
>
> @@ -94,6 +94,7 @@ sub format_message {
> t => sub { Encode::decode(setting('charset') || 'utf8',
> POSIX::strftime( "%d/%b/%Y
> %H:%M:%S", localtime )) },
> T => sub { POSIX::strftime( "%Y-%m-%d %H:%M:%S", localtime
> ) },
> + U => sub { POSIX::strftime( "%Y-%m-%d %H:%M:%S", gmtime ) },
> P => sub { $$ },
> L => sub { $level },
> D => sub {
That sounds pretty sane and worthwhile, I'd support that change.
If you would like to be credited as an author via GitHub, feel free to
submit a pull request with it; if not, I'll make that change soon,
assuming other devs agree (it's such a simple and sensible addition I
see no reason why anyone would disagree :) ).
--
David Precious ("bigpresh") <davidp at preshweb.co.uk>
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan www.preshweb.co.uk/github
More information about the Dancer-users
mailing list