This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add a 'isotime' format to standard logging
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: anthonybaxter, loewis, tim.peters, vinay.sajip
Priority: normal Keywords: patch

Created on 2003-07-08 08:04 by anthonybaxter, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Messages (4)
msg44233 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2003-07-08 08:04
This patch adds a standard format string 'isotime' to go 
alongside 'asctime' in the standard logging module. The
'asctime' format is somewhat idiosyncratic (for
instance the
seconds,milliseconds part). 'isotime' produces UTC
timestamps 
in ISO8601 format, that is
%Y-%m-%dT%H:%M:%S.msecsZ
e.g.
2003-07-08T18:02:34.012Z

A good primer on ISO 8601 can be found at 
http://www.cl.cam.ac.uk/~mgk25/iso-time.html

I'm not entirely sold on the name 'isotime' - an
alternative
would be 'stdtime'. 

msg44234 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-07-08 08:35
Logged In: YES 
user_id=21627

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file. In addition, even if you
*did* check this checkbox, a bug in SourceForge
prevents attaching a file when *creating* an issue.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )
msg44235 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2003-07-13 23:25
Logged In: YES 
user_id=308438

The current implementation is supposed to produce ISO8601 
format by default, unless a specific date format is specified 
for the formatter. According to the above web page, the only 
way in which the current default format is non-standard is 
that no 'Z' is provided to indicate a UTC time; so I think the 
patch should not introduce a new 'stdtime' or 'isotime' format, 
but rather change the current formatting implementation so 
that the standard format is actually produced.

Currently, the millisecond separator is a comma (like log4j); 
Markus Kuhn's above page indicates that either a comma or a 
period are acceptable for this.

Of course, it may be that better support for standard 
date/time formats should not be implemented in logging, but 
in a general-purpose package which can be used not only by 
logging, but by other applications which need this 
functionality.

Anthony, nice to see that you are taking another look at 
logging :-)
msg44236 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-03-20 20:59
Logged In: YES 
user_id=31435

There's still no patch here, and it's heading on a year since 
this was opened, so closing as Invalid.  If someone wants 
to "do something" here, please open a new report with an 
actual patch.
History
Date User Action Args
2022-04-10 16:09:50adminsetgithub: 38816
2003-07-08 08:04:32anthonybaxtercreate