News for hackers. Stuff that matters.
Re:My Logging Best Practices (2020) by jayknight on Tuesday October 05, 2021 @11:43AM (#28761004)
I think he is assuming that the logged exception will include the details needed to track down the error (line number, stack trace)
Re:My Logging Best Practices (2020) by adrianmsmith on Tuesday October 05, 2021 @11:45AM (#28761030)
Of course in an ideal scenario that's the case. Nevertheless programs do sometimes just "crash" without an error message, or maybe they hang and never produce any output due to an infinite loop, or excessive memory allocation and GC overhead, etc. Logging what the program was attempting to do is useful in those scenarios.
Re:My Logging Best Practices (2020) by sagichmal on Tuesday October 05, 2021 @11:14PM (#28768746)
Yes, it’s useful, but that occasional usefulness is substantially outweighed by it’s perpetual cost.
Re:My Logging Best Practices (2020) by bobbyi on Tuesday October 05, 2021 @02:29PM (#28763534)
Yes. I think logging before is still useful, but it is for hangs, not exceptions.

If your program disappears into a black hole doing some operation that doesn't have (and needs) a timeout specified, you want to know what it was about to do when you last heard from it.