You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/10 04:34:32 UTC

[GitHub] [pulsar] wuzhanpeng opened a new pull request #11993: [FEATURE] support for resetting logger level in runtime

wuzhanpeng opened a new pull request #11993:
URL: https://github.com/apache/pulsar/pull/11993


   ### Motivation
   This PR supplements a useful feature that enable users to reset logger level in runtime. It is very meaningful for developers to dynamically adjust the log level in the production environment, especially in the case of tracing online problems and unable to restart the broker process.
   
   ### Modifications
   
   - add an REST endpoint for resetting (/brokers/configuration/log4j/{logger}/{level})
   - add a companion admin cmd under `broker` (bin/pulsar-admin brokers reset-logger-level)
   
   ### Verifying this change
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Run`bin/pulsar-admin brokers reset-logger-level --level debug --logger root` after broker start to check log level*
     - *Run`bin/pulsar-admin brokers reset-logger-level --level info --logger root` to restore*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
     - `The rest endpoints: yes`
     - `The admin cli options: yes`
     - Anything that affects deployment: no
   
   ### Documentation
   
   - [x] doc-required 
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] wuzhanpeng commented on pull request #11993: [FEATURE] support for resetting logger level in runtime

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on pull request #11993:
URL: https://github.com/apache/pulsar/pull/11993#issuecomment-916806265


   @eolivelli @codelipenghui @hangc0276 Can you help review ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] github-actions[bot] commented on pull request #11993: [FEATURE] support for resetting logger level in runtime

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #11993:
URL: https://github.com/apache/pulsar/pull/11993#issuecomment-1057583423


   The pr had no activity for 30 days, mark with Stale label.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] wuzhanpeng commented on pull request #11993: [FEATURE] support for resetting logger level in runtime

Posted by GitBox <gi...@apache.org>.
wuzhanpeng commented on pull request #11993:
URL: https://github.com/apache/pulsar/pull/11993#issuecomment-917793816


   > This will only work for log4j, although it might not be the used logger.
   > 
   > I think we should rely on the logger library to do this kind of operations. Log4j2 has already the option to monitor the log configuration file and update the settings.
   
   Thanks for your suggestions! As far as I know, `slf4j-1.X` currently does not support dynamically modify the log level, but this feature is hopefully implemented in `2.X`(see [this issue](https://jira.qos.ch/browse/SLF4J-124)). In addition, log4j natively supports jmx so that we can use mbeans to remotely monitor and control loggers, but it only supports the loggers predefined in the configuration file. With that in mind, this PR is dedicated to allow all loggers to log at a dynamic level avoiding the operation of modifying the configuration file and then restarting.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org