jberling

jberling

Structured logging on localhost

One thing I miss from developing native apps with Swift is the structured logging in the Console app.

I loathe scanning text logs and find Elixir’s output hard to scan. It’s often just a wall of text. Like in this screenshot:

Is there a solution for sending the logs to either the Console app or a custom-made UI? A solution where maps are rendered as nicely as with GitHub - software-mansion/live-debugger: Tool for debugging LiveView applications. maybe?

Most Liked

hauleth

hauleth

Fixed that issue. I will try to revive it a little bit and remove dependencies on stuff like Cowboy, but that particular issue is fixed now.

jberling

jberling

Yeah, I’ve seen Logger supports structured logging.

I can live with that. If at least my own loggins are structured I am happy.

Ok, if no solution is there, maybe I should build it myself …

D4no0

D4no0

A solution for this would be great. I’ve had problems countless times with such long error messages, sometimes it would get so bad, that I would have to copy paste into a text editor and split it on my own to make any sense of it.

krasenyp

krasenyp

I’m amazed nobody has mentioned Syslog (RFC5425) yet. It’s old, well known, and allows structured and unstructured logging at the same time. Couple it with Promtail/Vector for forwarding logs to Loki and you have a production setup at home.

hauleth

hauleth

Maybe something like old project of mine GitHub - hauleth/lumberjack: Web based log viewer for Erlang and Elixir applications. It may not be actively maintained at the time of writing, but it is functional and more or less complete wrt. Elixir/Erlang logs.

Alternatively you can pipe your logs to something like Lnav to view them locally.

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

Other popular topics Top

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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement