3 ms·
> Overlogging is just as bad. It really is not: you can trim overlogging, you can't add missing logs. Now one thing I am very much in favor of, but which I di
by masklinn 5y ago
> Overlogging is just as bad.
It really is not: you can trim overlogging, you can't add missing logs.
Now one thing I am very much in favor of, but which I didn't see anywhere in TFA, is the ability to dynamically instrument instances (add or remove log points).
It's not necessarily easy to know what to log or not to log. With "normal" logging adding new log points is a complicated process (they're static so you have to introduce them, ensure they're correct, and then go through whatever deployment process you have), so there's a natural tendency to overlog because if you underlog you may miss critical information.
In systems where the capability exists, instrumenting log points "from the outside" without having to update the program being observed is much better, not only does it let you refine your logging more easily, it also lets you brutally increase logging density (possibly locally) without downtime.
- kfsdfjdf 5y agoThat's true. Annoying and pointless logs at least tell you where they are :). I suppose what I meant by this is in the heat of the moment having to sift through overlogging probably somewhat justifies the "no log" rant on the surface. But the underlying problem isn't logging but rather the abuse of it so it seems a little premature to blame logging itself for this.
- wizzwizz4 5y agoFor trimming logs, I load the whole log file into Python's REPL and repeatedly add >>> l = [x for x in l if ...] lines. I imagine there's a better way.
- icedchai 5y agoMaybe try "grep -v" ?
- spaetzleesser 5y agoI try to produce many small log files by hour or day. This makes it pretty easy to discard old logs or reduce the amount of data you have to look at if you know the problem was within a certain timeframe.
- pm90 5y agoAre there ways to do this? It sounds like an application restart would be warranted at the very least, which can be disruptive.
- masklinn 5y ago> Are there ways to do this? In some systems / runtimes, yes. For instance every browser supports "logging breakpoints" which can be added and removed on the fly (create a breakpoint then right click, you should get an option or sub-option about logging). I would also expect that there's Java instrumentation things which do it, though I haven't done any java for a very long time. It's pretty rare though, obviously so for runtime-less programs, somewhat less so for those with a runtime but while "external" profiling is common logging is much less so (e.g. Python supports updating the configuration of the existing static logging system on the fly, but not defining the log points). > It sounds like an application restart would be warranted at the very least, which can be disruptive. See above, if you can profile an application on the fly without restarting it you should be able to instrument for logging. And tools like dtrace/ebpf should allow this, but I've yet to take the plunge and actually try and look at that, it's only been an idle thought so far.