Home

Awesome

lager_slack

Simple Slack backend for lager

Format

lager_slack buffers incoming logs and sends them in packs of 20 logs per Slack message (as attachments).

Configuration

To use this backend you must provide it with a Slack Webhook link to specific channel.

{lager, [
  {handlers, [
    {lager_slack_backend, [
      {uri, "https://hooks.slack.com/..."}, % (required) Webhook URI
      {metadata, [pid, module]},            % Lager metadata appended to message (default: module)
      {sign, "MyApp"},                      % Message sign to identify your reports (appears in message footer)
      {level, error},                       % Log level (default: critical)
      {timeout, 5000},                      % (optional) Slack submit timeout in ms (default: 5000)
      {threshold, 20}                       % (optional) Max message attachement count (default/recommended: 20)
    ]}
  ]}
]}