Mark D. Baushke
2015-Oct-29 02:23 UTC
[Bug 2464] Adding timestamp to debug messages (log.c:do_log)
Darren Tucker <dtucker at zip.com.au> writes:> On Thu, Oct 29, 2015 at 12:32 PM, Mark D. Baushke <mdb at juniper.net> wrote: > > Diff updated with suggested changes (also, making the timestamp format > > ISO8601 compliant). > > > > Hmmm... full IOS8601 compliance would include the timzeone so the format > > I don't have a copy of the ISO8601 text, but the wikipedia page says > "If no UTC relation information is given with a time representation, > the time is assumed to be in local time." Which in this case it is.Hmmm... I could be wrong here as I have not read the actual ISO 8601 standard since 1999, but the form 'YYYY-MM-DD HH:MM:SS' is the form where the lack of a timezone indicated local time. I do recall that a default local time was generally discouraged as being ambiguous. In any case, I am more interested in syslog() being used rather than an ISO 8601 format time and wonder what use case needs to use strftime() foromats at all. -- Mark
Darren Tucker
2015-Oct-29 02:32 UTC
[Bug 2464] Adding timestamp to debug messages (log.c:do_log)
On Thu, Oct 29, 2015 at 1:23 PM, Mark D. Baushke <mdb at juniper.net> wrote:> Hmmm... I could be wrong here as I have not read the actual ISO 8601 > standard since 1999, but the form 'YYYY-MM-DD HH:MM:SS' is the form > where the lack of a timezone indicated local time.That's entirely possible, I've never read it and the text is not generally available. The wikipedia page gives an example with the "T" and without the timezone specifiier, though.> I do recall that a > default local time was generally discouraged as being ambiguous. > > In any case, I am more interested in syslog() being usedssh(1) can already do syslog: -y Send log information using the syslog(3) system module. By default this information is sent to stderr. -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Michael Stone
2015-Oct-29 22:53 UTC
[Bug 2464] Adding timestamp to debug messages (log.c:do_log)
On Thu, Oct 29, 2015 at 01:32:21PM +1100, Darren Tucker wrote:>On Thu, Oct 29, 2015 at 1:23 PM, Mark D. Baushke <mdb at juniper.net> wrote: >> Hmmm... I could be wrong here as I have not read the actual ISO 8601 >> standard since 1999, but the form 'YYYY-MM-DD HH:MM:SS' is the form >> where the lack of a timezone indicated local time. > >That's entirely possible, I've never read it and the text is not >generally available. The wikipedia page gives an example with the "T" >and without the timezone specifiier, though.At this point for most general purposes (like timestamping) it makes more sense to reference RFC 3339 rather than ISO 8601, which is freely available and has fewer options for people to screw up. AFAIK, the presence or absence of a T in an ISO 8601 timestamp has nothing to do with local time zone. The T is required in all cases of combined date and time unless people decide not to use it. My only criticism of RFC 3339 was failing to make the T mandatory. Mike Stone