   defdelegate compile(str), to: Logger.Formatter
 
   @doc """
-  Takes a compiled format and injects the level, message and metadata and returns a properly formatted JSON object where level, message and metadata properties are root JSON properties. Message is formated with Logger.Formatter.
+  Takes a compiled format and injects the level, message, node and metadata and returns a properly formatted JSON object where level, message, node and metadata properties are root JSON properties. Message is formated with Logger.Formatter.
   """
   @spec format({atom, atom} | [Logger.Formatter.pattern | binary],
                Logger.level, Logger.message, Logger.Formatter.time,

defmodule ExSyslog.JsonFormatter do
  @moduledoc """
  JsonFormatter is formatter that produces a properly JSON object string where the level, message and metadata are JSON object root properties.

  JSON object:
  ```
    {
      "level": "error",
      "message": "hello JSON formatter",
      "module": "MyApp.MyModule",
      "function": "do_something/2",
      "line": 21

              |> Logger.Formatter.format(level, msg, timestamp, metadata)
              |> to_string()

    log = %{level: level, message: msg_str, node: node()}

    {:ok, log_json} = metadata
                      |> Enum.reduce(log, &add_to_log/2)
