epimorphics / json-rails-logger

A custom rails logger that outputs JSON instead of raw text
MIT License
1 stars 1 forks source link

Timestamp logging changes #20

Closed ijdickinson closed 3 years ago

ijdickinson commented 3 years ago

Per the request from @andrew-pickin-epi, can you please:

andrew-pickin-epi commented 3 years ago

We probably need to standardise on a timestamp format as it looks like the buffering of docker/syslog/fluentd is bunching events and losing the required precision. It does appear, however, that there is a solution to re-index event with a fluentd filter using the client level timestamp. In short this field isn't just about usability now, it's vital to sequencing. I'm minded to say %Y-%m-%dT%H:%M:%S.%nNZ (or %FT%T.%nNZ) where n is 3 (or 6/9), but this will need to be co-ordinated with the parser.

bogdanadrianmarc commented 3 years ago

@andrew-pickin-epi Does the Z at the end stand for timezone? https://apidock.com/ruby/DateTime/strftime

If so, is this format ok: 2021-02-26 13:54:47.568 +00:00 ?

andrew-pickin-epi commented 3 years ago

No the Z is a literal (like the T between the date & time), and (I think) is supposed to indicate Zulu time aka UTC/GMT. I don't know how easy it is to fluentd to work with offssets. If you look at how flux is logging ts it has the literal T & Z. However I might have to tailor the parsing case by case as flux is using >3 decimal places.

bogdanadrianmarc commented 3 years ago

Done 👍