[Dancer-users] UTC timestamp for logger_format

Alex C calyx238 at gmail.com
Sat Apr 7 22:30:19 CEST 2012


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 {

--
Alex


More information about the Dancer-users mailing list