5 ms·
Some of the comments here are too wrong in the other direction. I'll come back to that. What I would have liked to see from the begining was something like: If
by 7532yahoogmail 7y ago
Some of the comments here are too wrong in the other direction. I'll come back to that. What I would have liked to see from the begining was something like:
If you must log then pipe the output into <????> which will store your log into a search system such that if you have a coordination id will bring logs from the various microservices together.
So what is ????
Log rotation, compression, disk space, getting FS space and making directories on large corporate networks is a pain. I also have to ssh around and compose logs. We also deal with servers in multiple timezones and most programmers are too dumb to put the TZ. Figuring out what TZ was ultimately used and sequencing it is stupid work. Yuck.
At my office the gdpr of logging is not well adopted. Logs are left in code really for debugging, to monitor a PR change in prod then forgotten later. You can see where that goes: waste
Also for a serious system with wide customer usage, the log should contain a errno like error (defined universe of errors with a set format), the use case, plus the details. Not whatever sprintf the programmer dreamed up.
The OP is also right here: logging is used as a bailout just in case thing because the programmer did not make a narrow contract in the method, service. Logging is used to find edge cases. That's not right.
Finally logs can be slow and some esp. c++ streams stuff may use mutexes.