Github user kxepal commented on the pull request:
https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-159319064
@rnewson
It does exactly runtime configurable logging and only. However, you cannot
just add few calls to `config:get` in couch_log because:
1. Somehow need to notify backends about changes in logging level. Lager
has own configuration file where level is set (now it's error). So if you do
"set backend stderr, set level warning, set backend lager", lager won't get log
level update and you have to reset it.
2. Subscription on config changes need to be done somewhere on the start.
Who and where should do that? The only reasonable candidate is couch_log
itself, so that's why I have to introduce app and sup.
3. You need somehow tolerate user input.
So it indeed can be limited by functional, but it will also have holes to
break the things.
While backend change in runtime is indeed not much useful, log level
changes is quite handy feature. Asking people to use remsh to change log level
is not very friendly way to go.
Filtering log messages on such top level serves two purposes:
1. Don't lie in the stats. Current behavior is that we trigger the counter
while there nothing actually get logged because of level restrictions. That is
very strange to record activity that didn't happened and confusing.
2. Use short circuit if we can. Since we make CouchDB config as
authoritative source of information about logging level, we can avoid call any
backend handler if we know that this give no effect.
In anyway, we should limited our ways to configure things and logging. Use
OS environment variables, application environment, special files is not a good
sign. After this, we have INI file only + special file for lager until we
figure something better.
Any alternative solutions are possible here?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---