News for hackers. Stuff that matters.
Re:Monitoring Is a Pain by guhidalg on Tuesday June 27, 2023 @11:08AM (#36493965)
This matches my experience in Azure. I'd add a few more:

o Log program inputs, outputs, and state changes. If you log something like "We are in function X", that's useless without a stack trace showing how we got to that state.

o Assume your developers are going to forgo logging "the right thing" and instrument the ** out of your application infrastructure (request/response processing, DB accesses, 3rd-party API calls, process lifecycle events, etc...).

o Make logging easy. I may get flamed but I think dependency injecting loggers is an anti-pattern. Logging is such a cross-cutting concern that its easier to have a static Logger or Metric object that is configured at startup. You do need some magic to prevent context from spilling from one request to another, but at least C# has these language features (AsyncLocal<T>) and I assume others do too.

o Your monitoring alert configuration should be in source control.

Re:Monitoring Is a Pain by klysm on Tuesday June 27, 2023 @01:29PM (#36496083)
DI logging is continent to just add extra context to the logs but I agree on static Log being always accessible in the same way everywhere
Re:Monitoring Is a Pain by mike22 on Wednesday June 28, 2023 @02:19PM (#36510412)
In Java, Lombok @Slf4j on a class is very convenient. Adds a static field for the logger.