LoggerLogglyBackend

Loggly logger backend for Elixir

Installation

  1. Add logger_loggly_backend to your list of dependencies in mix.exs:

    def deps do
    [{:logger_loggly_backend, "~> 0.1.0"}]
    end
  2. Ensure logger_loggly_backend is started before your application:

    def application do
    [applications: [:logger_loggly_backend, :httpoison]]
    end
  3. Configure the logger

    config :logger,
    backends: [{LoggerLogglyBackend, :loggly}, :console]
    
    config :logger, :loggly,
    host: "http://logs-01.loggly.com",
    type: :inputs,
    token: "your secret token",
    tags: ["http", "staging"],
    level: :error

The configuration defaults to:

config :logger, :loggly,
  host: "http://logs-01.loggly.com",
  timeout: 5000,
  type: :inputs,
  token: System.get_env("LOGGLY_TOKEN"), # so you can set the token as an environment variable which is recommended
  tags: [],
  level: :info