ElasticsearchLoggerBackend

Send logs in batches via the elasticsearch bulk index api!

Installation

If available in Hex, the package can be installed as:

  1. Add elasticsearch_logger_backend to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:elasticsearch_logger_backend, "~> 0.1.0"}]
end
```
  1. Ensure elasticsearch_logger_backend is started before your application:
```elixir
def application do
  [applications: [:elasticsearch_logger_backend]]
end
```

Usage

Application config:

  config :logger,
    backends: [{ElasticsearchLoggerBackend, :es_log}]

  config :logger, :es_log, [
    level: :info,
    index_format: "index-{YYYY}.{0M}.{0D}",
    elasticsearch_uri: "http://elasticsearch:9200/"
  ]

Runtime config:

  Logger.add_backend({ElasticsearchLoggerBackend, :es_log})
  Logger.configure_backend({ElasticsearchLoggerBackend, :es_log}, [
    elasticsearch_uri: "http://elasticsearch:9200/",
    index_format: "index-{YYYY}.{0M}.{0D}",
    level: :info,
  ])

Config Options