Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add UTC timestamp options for logger_format

  • Loading branch information...
commit ba78d07ed13cadbfca70d08316e8333a8c1becc5 1 parent edf780c
@perlpong perlpong authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 lib/Dancer/Logger/Abstract.pm
View
17 lib/Dancer/Logger/Abstract.pm
@@ -94,6 +94,9 @@ 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 { Encode::decode(setting('charset') || 'utf8',
+ POSIX::strftime( "%d/%b/%Y %H:%M:%S", gmtime )) },
+ U => sub { POSIX::strftime( "%Y-%m-%d %H:%M:%S", gmtime ) },
P => sub { $$ },
L => sub { $level },
D => sub {
@@ -178,7 +181,19 @@ host emitting the request
=item %t
-date (formatted like %d/%b/%Y %H:%M:%S)
+date (local timezone, formatted like %d/%b/%Y %H:%M:%S)
+
+=item %T
+
+date (local timezone, formatted like %Y-%m-%d %H:%M:%S)
+
+=item %u
+
+date (UTC timezone, formatted like %d/%b/%Y %H:%M:%S)
+
+=item %U
+
+date (UTC timezone, formatted like %Y-%m-%d %H:%M:%S)
=item %P
Please sign in to comment.
Something went wrong with that request. Please try again.