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 2022/04/13 09:15:15 UTC

[GitHub] [pulsar] jiahaoc1993 opened a new issue, #15158: Don't show logs from the pulsar client of Java

jiahaoc1993 opened a new issue, #15158:
URL: https://github.com/apache/pulsar/issues/15158

   **Is your enhancement request related to a problem? Please describe.**
   The pulsar client instance writes tons of logs to my logger, which is messing up our critical business logs. I would like to strip the pulsar relevant log from the logger.
   
   **Describe the solution you'd like**
   Add a parameter to the constructor of the pulsar client, and let the user decides where to write logs.
   
   
   


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

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


[GitHub] [pulsar] BewareMyPower commented on issue #15158: Don't show logs from the pulsar client of Java

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #15158:
URL: https://github.com/apache/pulsar/issues/15158#issuecomment-1097893417

   There is no need to add a parameter, Pulsar client uses [SLF4J](https://www.slf4j.org/) as its logger. You can choose an any SLF4J compatible logging framework.
   
   For example, I import `slf4j-simple` as the runtime dependency.
   ```xml
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
         <version>1.7.30</version>
         <scope>runtime</scope>
       </dependency>
   ```
   
   Then I add a `simplelogger.properties` to retain only warn and error level logs.
   
   ```properties
   org.slf4j.simpleLogger.defaultLogLevel=warn
   org.slf4j.simpleLogger.showDateTime=true
   org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS%  
   ```
   
   In production, I think you can choose a more flexible logging framework like `slf4j-log4j2` and customize your logger configuration file to specify the log path.


-- 
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] BewareMyPower commented on issue #15158: Don't show logs from the pulsar client of Java

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #15158:
URL: https://github.com/apache/pulsar/issues/15158#issuecomment-1098785218

   It's an issue about log4j configuration, you'd better learn more from the [log4j documentation](https://logging.apache.org/log4j/2.x/manual/configuration.html).
   
   ```yaml
       Logger:
         # TODO: specify the package name of pulsar-client, log level and appender
         - name: org.apache.pulsar.client
           level: warn
           additivity: false
           AppenderRef:
             - ref: Console
   ```


-- 
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] jiahaoc1993 commented on issue #15158: Don't show logs from the pulsar client of Java

Posted by GitBox <gi...@apache.org>.
jiahaoc1993 commented on issue #15158:
URL: https://github.com/apache/pulsar/issues/15158#issuecomment-1099823670

   @BewareMyPower  it's working great, 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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] jiahaoc1993 closed issue #15158: Don't show logs from the pulsar client of Java

Posted by GitBox <gi...@apache.org>.
jiahaoc1993 closed issue #15158: Don't show logs from the pulsar client of Java
URL: https://github.com/apache/pulsar/issues/15158


-- 
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] jiahaoc1993 commented on issue #15158: Don't show logs from the pulsar client of Java

Posted by GitBox <gi...@apache.org>.
jiahaoc1993 commented on issue #15158:
URL: https://github.com/apache/pulsar/issues/15158#issuecomment-1098668676

   @BewareMyPower  Thanks for the reply. Actually, I am using SLF4j on log4j, but how could I redirect all pulsar client relevant logs to /dev/null while remaining others without changes ;).


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