lager_humio_backend
Erlang Lager backend for Humio log management system
Requirements
- Erlang 18 or newer
- Humio account and API token
Dependencies
Project depends on jiffy library for JSON parsing and uses default HTTP client (httpc).
Usage
$ rebar3 update compileor
$ rebar get-deps && rebar compileSetup
First you have to sign up with Humio service to get all required information for setting up logging backend.
Configuaration
| Option | Required | Description |
|---|---|---|
host | Yes | Hostname of the Humio server (e.g. go.humio.com) |
token | Yes | Humio Ingestion API token (from Settings) |
source | Yes | Humio log source for log grouping and filtering |
level | Yes |
Minimal log level to use (defaults to debug) |
formatter | No |
The module to use when formatting log messages (defaults to lager_default_formatter) |
formatter_config | No |
The format configuration string (defaults to time [ severity ] message) |
metadata_filter | No | A list of excluded metadata keys |
retry_interval | No | Intervarl for retry in case endpoint is not available (defaults to 60 seconds) |
max_retries | No | Maximum number of retries (defaults to 10 retries) |
httpc_opts | No |
Set custom httpc:http_options() to change default HTTP client behaviour |
Sample configuration:
{lager, [
{handlers, [
{lager_console_backend, debug},
{lager_humio_backend, [{host, "cloud.humio.com"},
{token, "YOUR_INGESTION_API_TOKEN"},
{source, "YOUR_APPLICATION"},
{level, info}
]}
]}
}
Contributors
- Peter Mechlenborg - https://github.com/pmech