this post was submitted on 01 Sep 2023
337 points (96.2% liked)
Programming
17528 readers
295 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Putting more than 2 log levels (and, most of the time, putting more than 1 log level) into the logs your service outputs is a waste of time and just promises to make things confusing for the operator trying to make sense of what's happening. Just give people all the output and let them filter it however they want.
The only exception I'd make is maybe "trace" level where you spit out everything that happens, good or bad, which is just there for you (the programmer) to make sense of bugs.
So, error logs, warnings, informational, and debug logs should all just go to
stdout
at all times, no--verbose
or-vvv
should exist, everyone who wants to filter logs will have to pipe it throughgrep
or some other program to help filter the logs? Or am I understanding that incorrectly?Yep, that's the take. Or you aggregate logs and search them through a search interface. Or you output structured logs, and use structured search.
The take