Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Ideas for programs that don't exist: 2

This is a new oc­ca­sion­al se­ries of posts where I will share ideas for pro­grams that don't ex­ist, but should. The goal is to in­spire de­vel­op­ers to cre­ate use­ful tools that can make our lives eas­i­er. Or, more like­ly, to re­mind me about these ideas so I can cre­ate them my­self. Or even more like­ly, to just get them out of my head so I can stop think­ing about them.

Idea 2: A nice web frontend for journald

I do some self host­ing. It's tempt­ing, when you self­-host, to run things as if it was a com­pa­ny's pro­duc­tion set­up. So, there are some who run mul­ti­ple large servers on ku­ber­netes and so on.

Not me, I run a sin­gle SBC with a bunch of dock­er­ized ser­vices.

So, how do I see logs if some­thing goes wrong?

Well, I log to the system's journal, so I can use journalctl to see the logs.

It's just this bit of YAML in your com­pos­er def­i­ni­tion:

  logging:
    driver: "journald"
    options:
      tag: "whatever"

That tags the logs from that con­tain­er with "what­ev­er". So, I can run:

journalctl -t whatever

This tool, journalctl is quite nice, and you can filter by date, grep for things, follow the live logs, and so on. But it's a command line tool, which I like.

But the ¨do it like a re­al prod thing"crowd us­es logstash or some­such, and have a web dash­board for this kind of things.

Well, I should have one of those too, but backed by journalctl

There is one that comes with sys­temd, but it's sort of crap­py, and there is no rea­son for it to be. It's run­ning in the same serv­er where the logs are, it's sim­ple, and it would be a nice lit­tle project to do.


Contents © 2000-2025 Roberto Alsina