MRdotB

MRdotB

DiscoLog - Use Discord as a logging service and error tracking solution

Hello,

I’m excited to introduce DiscoLog, a logging service and error tracking solution for Elixir that uses a Discord server as its backend.

Setup

DiscoLog is easy to set up with a mix task that creates three channels for you:

  • #occurrences: A forum-style channel where errors are grouped by fingerprint and tagged, making it easy to track and manage them.
  • #info: This channel pipes the output of Logger.info directly to Discord, keeping you informed of general application events.
  • #error: This channel pipes the output of Logger.error. If the logger content is not an exception, it goes here; otherwise, it’s routed to #occurrences.

Additionally, DiscoLog have integration with Plug, Phoenix, LiveView, and Oban to provide extra context through :telemetry

Additionally, DiscoLog includes a :logger handler that converts exceptions into error occurrences, even for processes that lack specific integrations, such as GenServer crashes.

By using Discord, DiscoLog benefits from built-in notifications through the Discord app. Another advantage of the forum channel is the ability to prevent specific errors from triggering notifications repeatedly.

The Story Behind DiscoLog

DiscoLog is built upon the foundations of error_tracker, for the :logger handler, I borrows a lot of code from sentry-elixir and appsignal-elixir

The idea for DiscoLog emerged while experimenting with Discord’s Bot API. I realized that the Discord Forum Channel type could serve as a good solution for error tracking. The primary challenge was Discord’s limited message size, but I overcame this by utilizing message attachments to handle larger payloads.

https://github.com/mrdotb/disco-log

Most Liked

MRdotB

MRdotB

:rocket: v1.0.0 Released!
I’m excited to announce the release of DiscoLog v1.0.0! This update introduces two optional features:

  • Presence Status – Allows your bot to appear online, representing your node in Discord.
  • Go To Repo – Provides a direct link to GitHub (or a similar platform) to check the code where an error was triggered.

Additionally, it’s now possible to use the Discord client for ad hoc usage, though examples are not yet available.

:movie_camera: New Demo: I’ve created a YouTube video showcasing the Presence Status and Go To Repo features

:folded_hands: Huge thanks to @martosaur for implementing the Presence Status feature and refactoring the code to support ad hoc usage

MRdotB

MRdotB

I released disco_log v0.5.1:

  • it fixes an issue that was crashing the logger handler because some elixir type can’t be serialized as is

Meanwhile I have been using it in production on multiples side projects.
I’m very satisfied with the error tracking ! :slight_smile:

Next features on my list are:

  • Go to code the idea is to be able to click the occurrence and to go to the relevant github code on the specfic branch / tag
  • Active presence message to make the bot display some info about the node
dimitarvp

dimitarvp

Wow that’s amazing, thanks for putting it together!

Where Next?

Popular in Announcing Top

sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
nikokozak
Hello all, I’ve been working on Svonix - a library for quickly integrating Svelte components into Phoenix views. It’s a much-needed succ...
New
aditya7iyengar
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections. Fo...
New
sabiwara
Dune is a sandbox for Elixir and aims to safely evaluate user-provided code. You can try it out using this basic Elixir playground made ...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 14482 100
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New

Other popular topics Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement