Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.

Home Page:https://nebo15.github.io/logger_json/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

timestamp is in wrong timezone

BrendanBall opened this issue · comments

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

@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.