Search code examples
datelogginguwsgi

uWSGI - log-date with milliseconds


I want to log file to display date as %a %b %d %H:%M:%S.%3N.

$ date '+%a %b %d %H:%M:%S.%3N'
Mon Aug 27 12:15:36.954

I already found that because of a collision I needed to set log-date = %%a %%b %%d %%H:%%M:%%S.

But can't get the milliseconds nor nanoseconds to work...


Solution

  • strftime() does not support milliseconds nor nanoseconds.

    You have to rely on lower-level systems:

    uWSGI LogFormat

    Unfortunately this requires uWSGI v1.3+.