Re:My Logging Best Practices (2020)
by Jowsey on Tuesday October 05, 2021 @12:45PM
(#28761926)
Why not have the program write logs to a temp file somewhere at trace/debug level, and only output the standard level to the console?
[ Parent
| on HN ]
Wouldn't that end up slowing down the whole system from writing to a file though?
Ah, suppose it depends on how much you're doing and/or how verbose your logs are. If you've got lines speeding past then yeah I maybe wouldn't write them all.
Writing verbose logs is very expensive.
It depends which costs what.
In a case where there are plenty of resources and the thing you are logging is very heavy then even verbose logging is trivial.
If you are beset by failures it is much cheaper than making your developers guess.