Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azohra/quack
An Elixir Logger backend for slack
https://github.com/azohra/quack
backend elixir exporter logger slack
Last synced: 7 days ago
JSON representation
An Elixir Logger backend for slack
- Host: GitHub
- URL: https://github.com/azohra/quack
- Owner: azohra
- License: mit
- Created: 2018-11-15T19:46:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-13T21:12:49.000Z (almost 6 years ago)
- Last Synced: 2024-09-17T23:42:24.895Z (about 2 months ago)
- Topics: backend, elixir, exporter, logger, slack
- Language: Elixir
- Size: 276 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Quack
[![Hex pm](http://img.shields.io/hexpm/v/quack.svg?style=flat)](https://hex.pm/packages/quack)
[![GitHub license](https://img.shields.io/github/license/azohra/Quack.svg)](https://github.com/azohra/Quack/blob/master/LICENSE.md)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`:
```elixir
def deps do
[
{:quack, "~> 0.1.1"}
]
end
```Then add Quack to your list of extra applications:
```elixir
def application do
[
mod: {MyApplication, []},
extra_applications: [:logger, :quack]
]
end
```## Configuration
Configure the Slack incoming webhook:
```elixir
config :quack, webhook_url: "https://hooks.slack.com/services/...."
```Configure your Logger application to use Quack as a backend:
```elixir
config :logger, backends: [:console, Quack.Logger]
```Configure the minimum-level of logs you want exported to Slack:
```elixir
# Options are [:debug, :info, :warn, :error]
config :quack, level: :debug
```Configure which metadata you want to report on:
```elixir
# 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:
```elixir
config :quack,
level: :info,
meta: [:file, :function, :line],
webhook_url: "https://hooks.slack.com/services/..."config :logger, backends: [:console, Quack.Logger]
```## Examples
![debug message](docs/debug.png)
![info message](docs/info.png)
![warning message](docs/warning.png)
![error message](docs/error.png)