You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/12/17 08:45:13 UTC

[GitHub] [rocketmq-client-cpp] fengxiao2019 opened a new issue #391: How to export the debug information of the consumer?

fengxiao2019 opened a new issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391


   I set the log level to **DEBUG** via the function `SetPushConsumerLogLevel`, i can see the produced logs. but I don't see the debug log of the relevant consumer in the log file.
   
   I use the rocketmq-client-python to set the log level.
   the code like this:
   ```
   class PushConsumerPro(PushConsumer):
       def set_log_level(self, log_level: ffi._CLogLevel) -> None:
           ans = ffi_check(ffi.dll.SetPushConsumerLogLevel(self._handle, log_level))
           print(f"set__log__level result: {ans}")
   ```
   
   os: centos 7.5
   branch: master
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] fengxiao2019 commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
fengxiao2019 commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997601930


   ```
   int SetPushConsumerLogLevel(CPushConsumer* consumer, CLogLevel level) {
     if (consumer == NULL) {
       return NULL_POINTER;
     }
     ((DefaultMQPushConsumer*)consumer)->setLogLevel((elogLevel)level);
     return OK;
   }
   ```
   SetPushConsumerLogLevel need the pointer of a consumer instance


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] fengxiao2019 commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
fengxiao2019 commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997607318


   Okay, I'll try this afternoon, thanks.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] ifplusor commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
ifplusor commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997600446


   IMO, you need call ```SetPushConsumerLogLevel``` first, then call ```CreatePushConsumer``` and others.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] ifplusor commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
ifplusor commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997591841


   @fengxiao2019 You need call ```set_log_level()``` before do anything.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] ifplusor edited a comment on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
ifplusor edited a comment on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997600446


   @fengxiao2019 IMO, you need call ```SetPushConsumerLogLevel``` first, then call ```CreatePushConsumer``` and others.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] fengxiao2019 commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
fengxiao2019 commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997593830


   here is the source code :
   
   ```
       def create_consumer(self):
           self.consumer = PushConsumerPro(self.consumer_group_id)
           self.consumer.set_log_level(ffi._CLogLevel.LEVEL_NUM)
   ```
   PushConsumerPro source code:
   
   ```
   class PushConsumerPro(PushConsumer):
       def set_log_level(self, log_level: ffi._CLogLevel) -> None:
           ans = ffi_check(ffi.dll.SetPushConsumerLogLevel(self._handle, log_level))
           print(f"set__log__level result: {ans}")
   ```
   PushConsumer's source code:
   the code come from **rocketmq-client-python**:
   ```
   class PushConsumer(object):
       def __init__(self, group_id, orderly=False, message_model=MessageModel.CLUSTERING):
           self._handle = dll.CreatePushConsumer(_to_bytes(group_id))
           if self._handle is None:
               raise NullPointerException('Returned null pointer when create PushConsumer')
           self._orderly = orderly
           self.set_message_model(message_model)
           self._callback_refs = []
   ```
   you mean I should call `set_log_level` before `self.set_message_model(message_model)` ?


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] ifplusor commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
ifplusor commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997607233


   At this moment, the logger in rocketmq is GLOBAL, and config the level of it is separate from consumer.


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] ifplusor commented on issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
ifplusor commented on issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391#issuecomment-997604551


   > ```
   > int SetPushConsumerLogLevel(CPushConsumer* consumer, CLogLevel level) {
   >   if (consumer == NULL) {
   >     return NULL_POINTER;
   >   }
   >   ((DefaultMQPushConsumer*)consumer)->setLogLevel((elogLevel)level);
   >   return OK;
   > }
   > ```
   > 
   > 
   >      
   >   
   > 
   > SetPushConsumerLogLevel need the pointer of a consumer instance
   
   It's so crazy. I think you need disable this log to make it work. https://github.com/apache/rocketmq-client-cpp/blob/6523dcc3b309a1065375e40657f68f66bfeca38d/src/consumer/DefaultMQPushConsumerImpl.cpp#L226


-- 
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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq-client-cpp] fengxiao2019 closed issue #391: How to export the debug information of the consumer?

Posted by GitBox <gi...@apache.org>.
fengxiao2019 closed issue #391:
URL: https://github.com/apache/rocketmq-client-cpp/issues/391


   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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