UTC timestamp for logger_format
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
On Sat, 7 Apr 2012 21:30:19 +0100 Alex C <calyx238@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@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
I agree with this change, seems a good added feature On 8 April 2012 16:32, David Precious <davidp@preshweb.co.uk> wrote:
On Sat, 7 Apr 2012 21:30:19 +0100 Alex C <calyx238@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@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 _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
PR: https://github.com/sukria/Dancer/pull/773 Thanks On 9 April 2012 16:32, damien krotkine <dkrotkine@gmail.com> wrote:
I agree with this change, seems a good added feature
On 8 April 2012 16:32, David Precious <davidp@preshweb.co.uk> wrote:
On Sat, 7 Apr 2012 21:30:19 +0100 Alex C <calyx238@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@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 _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Merged, y'all. :) On Tue, Apr 10, 2012 at 4:01 AM, Alex C <calyx238@gmail.com> wrote:
PR: https://github.com/sukria/Dancer/pull/773
Thanks
On 9 April 2012 16:32, damien krotkine <dkrotkine@gmail.com> wrote:
I agree with this change, seems a good added feature
On 8 April 2012 16:32, David Precious <davidp@preshweb.co.uk> wrote:
On Sat, 7 Apr 2012 21:30:19 +0100 Alex C <calyx238@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@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 _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
participants (4)
-
Alex C -
damien krotkine -
David Precious -
sawyer x