Skip to content
An Elixir Logger backend for slack
Elixir Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config initial commit Nov 15, 2018
docs
lib performance improvements Dec 13, 2018
test
.formatter.exs initial commit Nov 15, 2018
.gitignore initial commit Nov 15, 2018
CHANGELOG.md
LICENSE.md
Makefile
README.md
mix.exs
mix.lock prepare for release Nov 15, 2018

README.md

Quack

Hex pm GitHub license

A simple, yet beautiful, Elixir Logger backend for Slack

Installation

The package can be installed by adding quack to your list of dependencies in mix.exs:

def deps do
  [
    {:quack, "~> 0.1.1"}
  ]
end

Then add Quack to your list of extra applications:

  def application do
    [
      mod: {MyApplication, []},
      extra_applications: [:logger, :quack]
    ]
  end

Configuration

Configure the Slack incoming webhook:

  config :quack, webhook_url: "https://hooks.slack.com/services/...."

Configure your Logger application to use Quack as a backend:

  config :logger, backends: [:console, Quack.Logger]

Configure the minimum-level of logs you want exported to Slack:

  # Options are [:debug, :info, :warn, :error]
  config :quack, level: :debug

Configure which metadata you want to report on:

  # You can specify a list of containing these fields: 
  #   [
  #     :application,
  #     :module,
  #     :function,
  #     :file,
  #     :line,
  #     :pid,
  #     :crash_reason,
  #     :initial_call,
  #     :registered_name
  #   ]

  config :quack, meta: [:file, :function, :line]

  # Or you can specify absolutes such as :all, or :none
  config :quack, meta: :none

The complete configuration should look something like this:

  config :quack,
    level: :info,
    meta: [:file, :function, :line],
    webhook_url: "https://hooks.slack.com/services/..."

  config :logger, backends: [:console, Quack.Logger]

Examples

debug message info message warning message error message

You can’t perform that action at this time.