Log Timeline Format
Most log lines contain a timestamp and a description of the event:
[When] [What]
eg:.
[23/Jul/2013:19:35:11 +0000] Processing started. [23/Jul/2013:19:36:11 +0000] Processed 1000 items. [23/Jul/2013:19:37:11 +0000] Processing finished successfully.
I am trying to find a standard timestamp for my log lines. My criteria:
- Human readable . I want to easily understand when the event occurred.
- Sort alphabetically . When I
grep events from several files and sort them using POSIX sort or even the word / excel, I want the alphabetical sort to match the chronological type. For example, [23/Jul/2012:19:35:11 +0000] and [22/Jul/2013:19:35:11 +0000] not sorted - the 2013 line will appear before the 2012 line. - Easily parsed by all common languages . The timestamp should be easily analyzed using standard strptime if the log is being processed by the script.
The only standard I have found so far is ISO_8601 , which has many options (e.g. 2007-04-05T14:30Z and 2007-03-01T13:00:00Z ), and does not have a specific standard for log line events.
Could you recommend a standard timestamp format for log lines?
source share