3 ms·
"The possibility to change the minimum log level required to trigger the rule seems sensible because we might want to adjust it on the fly for debugging reasons
by taylodl 11y ago
"The possibility to change the minimum log level required to trigger the rule seems sensible because we might want to adjust it on the fly for debugging reasons. Nevertheless, odds are we never appeal to it in practice. So, we are better off removing this setting as well."
Everything was going fine until I got to this point. You can't tell when you'll need to adjust the log level on the fly and he's right in stating most likely you'll never do it, but when you need to do it you need to do it - and predicting that need is impossible. This is one of those rare things where it's better to have it and not need it than to need it and not have it.
Otherwise this is a good article on addressing the issue of configuration hell.
- vambo 11y agoIt was also going fine for me up to that section but for different reasons: I think it makes sense to postpone/avoid externalizing configuration, but in case where a configuration is the default format (e.g. logging), going the extra mile to define that in code is both time-consuming and produces a less readable result. So I think the goal should not be to avoid configuration files, just avoid wasting time in making things configurable which probably never need to be re-configured. Your point is also very valid though.
- falcolas 11y agoI find the happy medium here is a command line parameter. Hard code the default to something sensible, and have a command line parameter (-v) which overrides the sensible default. No need to recompile, no need to worry about the parameter 99% of the time.
- lmm 11y agoIf you can't deploy your application in half an hour and without interrupting service, you have bigger problems; solve those first. Maybe you'll need to change the log level faster than that. Maybe you'll be hit by a meteorite. But building in that kind of flexibility isn't worth it.
- wallyhs 11y agoSince the site is Enterprise Craftsmanship, I read it from that angle. In my experience, deployments must be requested several days in advance and require approvals from managers, testers, analysts, and functional experts. Quick "emergency" changes require extra approvals and are reviewed periodically. Minor configuration changes don't have nearly as many restrictions. In that type of environment, I think it is absolutely worth the flexibility. And "building in" that kind of flexibility means to, um, add a line to the existing configuration file.