I don't know where to log for production stuff.
Like, for datascience stuff where fail means bail, it's easy -- at the point of failure. But for my #golang long-lived processes, I'm really not sure what to do.
But given error propagation in #golang, where is the actual log call appropriate? First encounter? Three calls up in application code? I've read conflicting things and I have no intuition for what's going to bite me later.
-
-
It likely depends on your own decisions. You could log every time you create a new error and every time another library throws an error, and reduce from there. Just don't want to miss a potential log that could have saved you from a mysterious crash/problem.
-
Imo, log up at a "useful level of work". (Requestid, jobId, eg) Throw the error as close as possible to debug, but catch and log in a more centralized spot. At least that's how we do it in practice.
- 1 more reply
New conversation -
-
-
Just buy a lot of splunk and figure it out later
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.