Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.
https://nebo15.github.io/logger_json/
MIT License
237 stars 92 forks source link

timestamp is in wrong timezone #82

Closed BrendanBall closed 2 years ago

BrendanBall commented 2 years ago

The following assumes the timestamp is in UTC:

  def format_timestamp({date, time}) do
    [format_date(date), ?T, format_time(time), ?Z]
    |> IO.iodata_to_binary()
  end

however {date, time} seems to be provided in localtime, which means that this library ends up logging incorrect timestamps

AndrewDryga commented 2 years ago

@BrendanBall I think here we doing what everyone else (including Elixir Logger itself) are doing: we logging timestamps that Erlang :logger is sending to us. So if it's (and machine on which it's running) configured properly then we should be good.