LokiLogger

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

Hex.pm Version

Known issues

Features (and 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.3.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"

Protobuff lib regeneration

only needed for development

protoc --proto_path=./lib/proto --elixir_out=./lib lib/proto/loki.proto

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.