LoggerLogglyBackend
Loggly logger backend for Elixir
Installation
Add logger_loggly_backend to your list of dependencies in
mix.exs:def deps do [{:logger_loggly_backend, "~> 0.1.0"}] endEnsure logger_loggly_backend is started before your application:
def application do [applications: [:logger_loggly_backend, :httpoison]] endConfigure 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
- type can be one of :inputs or :bulk
- tags can be any string
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