cloudfoundry / lager

An opinionated logger for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide warning level

glyn opened this issue · comments

Sometimes warnings are necessary. Warnings usually indicate something which is unexpected, but not necessarily erroneous. It wouldn't be appropriate to log an error as this could distract someone trying to diagnose a true error. But warnings are definitely more serious than an informational log and so deserver their own log level.

Hi Ted

Why did you close this? If you decided not to implement it, I'd appreciate a sentence saying why.

Thanks,
Glyn

Sorry Glyn, I thought this was a dead issue. We are looking at moving lager to OpenTracing, so I'm cleaning up the issues github project.

In regards to adding a Warn level, the problem with warns is not that they are unnecessary, but that they are insufficient. Often what you want to warn on is a measurement - something taking too long, or occurring too frequently, or exceeding a certain value.

Embedding these warnings statically in your program often creates false positives, while not being a flexible enough solution to apply to many warnings that emerge in production deployments. For example, what counts as a dangerous level of Foo is often dependent on the size of your deployment.

The effect of this is that developers tend to ignore warns, and have to set up monitoring and alerting anyways. So the solution we are aiming for is to trace the system comprehensibly enough to be able to dynamically measure and alert in our monitoring software. Then, as part of our recommended instance sizes and other deployment advice we give out, I would like to give out a base set of trace measurements we suggest all operators monitor.

Thanks. It's very helpful to understand the rationale.