Can i change time format in access log?

Hi, EveryBody!

I am really happy with nginx from now.
but I have one question.

I want to customize time format in access log, because of calculating
time.
There are two kind of time format in log_format.
one is $time_local. (21/Mar/2013:18:47:32 +0900)
another one is $time_iso8601. (2013-03-26T10:27:40+09:00)
but, these are not matched by my demand.

I want to log time likes “2013-03-25 16:35:35”…

can i customize time format ?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,237780,237780#msg-237780

On Mon, Mar 25, 2013 at 10:29:22PM -0400, appchemist wrote:

I want to customize time format in access log, because of calculating time.
There are two kind of time format in log_format.
one is $time_local. (21/Mar/2013:18:47:32 +0900)
another one is $time_iso8601. (2013-03-26T10:27:40+09:00)
but, these are not matched by my demand.

There’s a third one, $msec. It’s time in seconds since UNIX Epoch,
with a milliseconds resolution, convenient if you need to further
process your logs and do time calculations.

I want to log time likes “2013-03-25 16:35:35”…

can i customize time format ?

Such a customization isn’t possible.

Thank you very much! :slight_smile:

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,237780,237786#msg-237786

I have one more question about access log.
there is a +0900 in 21/Mar/2013:18:47:32 +0900,
2013-03-26T10:27:40+09:00

what does +0900 mean?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,237780,237787#msg-237787

On Tue, Mar 26, 2013 at 02:22:39AM -0400, appchemist wrote:

I have one more question about access log.
there is a +0900 in 21/Mar/2013:18:47:32 +0900, 2013-03-26T10:27:40+09:00

what does +0900 mean?

It’s the the as “+09:00” to the right. :slight_smile:

http://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs