The Role of Logs
You likely know a lot about logs. Here's an overview of logging, and the part logs play in debugging, and general performance maintenance.
Join the DZone community and get the full member experience.Join For Free
you are probably familiar with logging, and log levels. in particular, the following scheme is very popular.
i have been using this scheme for pretty much every software project i had in over a decade. and it works. which is good.
but i found that these are actually not really fulfill our requirements. in particular, we found that a component that logged something as a warning or error would often cause an eagle-eyed admin to generate a support ticket while it was just a valid part of the software behavior. the other side of that is that when we need to use the logs to find a problem, we never use fine-grained logs, we just need it all.
this leads me to believe that we only actually need two and a half levels.
- informative – we are reporting something so one of our support engineers or a team member can take a look and understand what the software is doing.
- operational – something deserves attention from the customer’s operations team.
there isn’t really anything in between those. either this is something that we fully expect an operation team at the customer to look at, or this is something that the development and/or support engineers need to see.
but i mentioned two and a half, what is that half? well, above operational, there is another half a level, which i like to call pay attention now. this isn’t actually a log level, it is a way to attract someone’s attention to the log, or to some sort of operational alert. this is an sms sent, or an email, etc.
but beyond the “something needs attention now”, there is nothing else that is needed. the production logs are either for routine operations monitoring (in which case they should be relatively succinct and written with an eye to a reader who isn’t familiar with the internal working of ravendb) or “what is going on here” mode, which is typically done by a team member who needs the most information possible.
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.