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/01/24 13:13:25 UTC

[GitHub] [pulsar] freeznet opened a new pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

freeznet opened a new pull request #9299:
URL: https://github.com/apache/pulsar/pull/9299


   Fixes #7814
   
   ### Motivation
   
   `JavaInstanceRunnable` create an instance of logger named `"function-" + instanceConfig.getFunctionDetails().getName()` and pass it to `Function Context`, and the logger can be used to send user defined content to function's log-topic if `--log-topic` defined.
   
   as issue #7814 mentioned, the logger is not working as expected since user cannot consume any self defined log content from `log-topic`.
   
   this happens in process runtime with created functions, but not noticed with other situation such as `localrun` function.
   
   Through debug to the created function, the logger from `Function Context` is different the logger from `JavaInstanceRunnable`, such as the `contextName` as images shown below. In addition, the `LogAppender` set in `JavaInstanceRunnable` is not shown in `Function Context`'s logger as well.
   
   ![Imgur](https://i.imgur.com/39DMH6R.png)
   ^^^^ from JavaInstanceRunnable
   
   ![img](https://i.imgur.com/UDw5Lzt.png)
   ^^^^ from Function Context
   
   After some tests, I find out that when get `LoggerContext` by `LoggerContext.getContext()`, the context's logAppender can be take effect to `Function Context`, and the `Function Context`'s logger works great.
   
   ### Modifications
   
   Add `LogAppender` to the single context from `LoggerContext.getContext()`.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] jiazhai commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] zymap commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   oops. The test seems failed. Please take a look.


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] jiazhai commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   > Can we add a test?
   
   @zymap thanks for the review, an integration test was added, please take another look when you have time ;)


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] jiazhai commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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






----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   > Can we add a test?
   
   @zymap thanks for the review, an integration test was added, please take another look when you have time ;)


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] freeznet commented on pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

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


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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.

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



[GitHub] [pulsar] sijie merged pull request #9299: [fix #7814] fix java function logging appender not added to java function logger

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #9299:
URL: https://github.com/apache/pulsar/pull/9299


   


----------------------------------------------------------------
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.

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