How to log the time in the UTC time format?

rmalayter nginx-forum at
Fri Dec 4 18:11:19 MSK 2009

Maxim Dounin Wrote:
> BTW, could you please explain why do you need time
> in this particular 
> format?

Many log parsing and event correlation tools need the time with miliseconds, which $time_local doesn't produce. However, many of these tools also cannot hanlde the "number if miliseconds since start of UNIX time" that nginx produces with $msec.

A nice option would be to output ISO-8601 format time stamps in logs, which just about every tool can handle, such as this:

These are also human-readable time stamps that include miliseconds, which is nice. Even Microsoft IIS can do this.


Posted at Nginx Forum:,26862,27966#msg-27966

More information about the nginx mailing list