astarte-platform / astarte_vmq_plugin

Astarte VerneMQ plugin publishes incoming messages on an AMQP exchange with some additional metadata, so they can be processed by other components.
http://astarte-platform.org/
Apache License 2.0
16 stars 10 forks source link

Logging is not consistent with the rest of Astarte components #33

Open rbino opened 4 years ago

rbino commented 4 years ago

We should standardize VerneMQ logging to use logfmt format like all other Astarte services.

Moreover, right now the logger does not print a date, just a timestamp, so it's hard to understand when something was logged if a problem is being debugged some days later.

Annopaolo commented 3 years ago

At the moment, VerneMQ does not support custom log formatting, so no date for now. There is a library for lager logfmt formatting, but it's outdated.

A possible workaround would be to forward Erlang Lager log messages (VerneMQ) to Elixir Logger (plugin). This approach presents two problems:

  1. Plugins' messages should be added to VerneMQ logs, and not the other way around (see this answer on the VerneMQ Slack);
  2. The only Lager backend to redirect messages to Logger is outdated, too (Elixir < 1.7.0).