LiveDashboard Logger: See logs from across your cluster in Phoenix Live Dashboard

Hey everyone :wave:

I was recently working on a hobby project that I have deployed on a platform that did not provide quick and easy access to my application’s logs, especially across different nodes.
Since Elixir Logger is very extensible, I thought it should not be hard to build something with Phoenix LiveView, which adds a new backend for the logger and then propagates them to my live view process using Phoenix PubSub across a cluster.

Well, I was right! It was actually fairly easy to do so. In the process, I even discovered Phoenix LiveDashboard custom pages and implemented one as a custom page for LiveDashboard. (See image below)

It does the job for my need and I decided to package it out so if someone else needs this they can also use it. One cool thing that I like about it is that it does not require adding any custom plugs or changing your app’s supervision trees.

Please let me know your suggestions and feedback :purple_heart:
Thanks!

9 Likes

Many thanks! I’ll use this for a project that the client will be hosting on their own server. Installation went fine, as expected.

My only thought is about adding a third option to remove the max-width of section#main.container, or to add some way of making the logs full-width, but that’s probably best as a general LiveDashboard thing? Anyway, I can, of course, use a custom user stylesheet in the browser.

2 Likes

Happy you found this useful :purple_heart:

but that’s probably best as a general LiveDashboard thing?

Yes it mostly is. In the next live-dashboard release we will also get log colors based on levels which was updated in live-dashboard css.

1 Like