Bug 57339 - ErrorLogFormat doesn't allow logging in Internet date/time format
Summary: ErrorLogFormat doesn't allow logging in Internet date/time format
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.10
Hardware: All Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2014-12-10 18:40 UTC by Marten Lehmann
Modified: 2019-07-30 11:52 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Marten Lehmann 2014-12-10 18:40:06 UTC
The ErrorLogFormat directive allows to log records with a format, that comes close to the Internet date/time format: ISO 8601 date + time without time zone

Format string: %{cu}t
Example timestamp: 2014-12-10 19:05:38.192439



This however is not enough if you are operating internationally and need to login in full Internet date/time format:

Example timestamp: 2014-12-10T19:05:38.192439+01:00

(Details: https://tools.ietf.org/html/rfc3339#section-5.8)

Actually, ISO 8601 specifies everything that is required, but the current httpd simply doesn't implement a timestamp that matches Wikipedias documentation:

Combined date and time in UTC: 2014-12-10T17:05:33+00:00 or 2014-12-10T17:05:33Z

I would be totally satisfied if Apache would at least support logging with a UTC timestamp:

Example timestamp: 2014-12-10T18:05:38.192439Z

ErrorLogFormat doesn't (yet) come with the %{format}t format string to be more flexible in specifying the format.

(Details: http://httpd.apache.org/docs/current/mod/mod_log_config.html)
Comment 1 Michael Osipov 2019-07-30 11:52:34 UTC
Actually, the current format isn't proper ISO 8601 because the 'T' separator is missing.

For those who operate internationally shall use 'Etc/UTC' on their servers, thus making the TZ offset redundant.