You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by kxepal <gi...@git.apache.org> on 2015/11/23 05:32:07 UTC

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

GitHub user kxepal opened a pull request:

    https://github.com/apache/couchdb-couch-log/pull/10

    Make couch_log configurable

    This allows to set logging backend and level via config API making
    logging configuration a bit closer as it was in CouchDB 1.x.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kxepal/couchdb-couch-log configurable-log

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch-log/pull/10.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #10
    
----
commit facde882d66b466687b7b55bcee94537551512ce
Author: Alexander Shorin <kx...@apache.org>
Date:   2015-11-23T04:25:02Z

    Make couch_log configurable
    
    This allows to set logging backend and level via config API making
    logging configuration a bit closer as it was in CouchDB 1.x.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by kxepal <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#discussion_r45756798
  
    --- Diff: src/couch_log.app.src ---
    @@ -0,0 +1,26 @@
    +% Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +% use this file except in compliance with the License. You may obtain a copy of
    +% the License at
    +%
    +%   http://www.apache.org/licenses/LICENSE-2.0
    +%
    +% Unless required by applicable law or agreed to in writing, software
    +% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    +% License for the specific language governing permissions and limitations under
    +% the License.
    +
    +{application, couch_log, [
    +    {description, "CouchDB Log API"},
    +    {vsn, git},
    +    {modules, [
    +        couch_log,
    --- End diff --
    
    Ok


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-159312002
  
    This does more than make the backend runtime-configurable (I'm not sure why that would be useful tbh), it also makes the top-level very prescriptive about log level filtering. I don't really like it.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-159157809
  
    Ok, should be better now.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by jaydoane <gi...@git.apache.org>.
Github user jaydoane commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-159083973
  
    I tested this patch locally, and it seems to work fine. Specifically, the [log] level = none in rel/files/eunit.ini suppresses logging during test runs.
    +1


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-160966093
  
    Ok, since no alternatives suggested, let's make it so and improve later.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by mikewallace1979 <gi...@git.apache.org>.
Github user mikewallace1979 commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-159078852
  
    +1


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-159118403
  
    Good to hear! I'll fix few more issues here (need a better level name cast and fix couch_log_app hack), test a bit more and then will merge. Stay tuned! (:


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-couch-log/pull/10


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#discussion_r45752578
  
    --- Diff: src/couch_log.app.src ---
    @@ -0,0 +1,26 @@
    +% Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +% use this file except in compliance with the License. You may obtain a copy of
    +% the License at
    +%
    +%   http://www.apache.org/licenses/LICENSE-2.0
    +%
    +% Unless required by applicable law or agreed to in writing, software
    +% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    +% License for the specific language governing permissions and limitations under
    +% the License.
    +
    +{application, couch_log, [
    +    {description, "CouchDB Log API"},
    +    {vsn, git},
    +    {modules, [
    +        couch_log,
    --- End diff --
    
    empty this out, rebar will populate it for us automatically, it can, at best, be duplication.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-log pull request: Make couch_log configurable

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch-log/pull/10#issuecomment-158852409
  
    cc @eiri @jaydoane 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---