LokiLogger

LokiLogger is an Elixir logger backend providing support for Logging to Grafana Loki

Hex.pm Version

Known issues

TODO

Installation

The package can be installed by adding loki_logger to your list of dependencies in mix.exs:

def deps do
  [
    {:loki_logger, "~> 0.1.0"}
  ]
end

Configuration

Elixir Project

Loki Logger's behavior is controlled using the application configuration environment:

For example, the following config/config.exs file sets up Loki Logger using level debug, with application label loki_logger_library.

use Mix.Config

config :logger,
       backends: [LokiLogger]

config :logger, :loki_logger,
       level: :debug,
       format: "$metadata level=$level $levelpad$message",
       metadata: :all,
       max_buffer: 300,
       loki_labels: %{application: "loki_logger_library", elixir_node: node()},
       loki_host: "http://localhost:3100"

License

Loki Logger is copyright (c) 2019 Ward Bekker

The source code is released under the Apache v2.0 License.

Check LICENSE for more information.