You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lifepuzzlefun (via GitHub)" <gi...@apache.org> on 2023/06/15 14:11:19 UTC

[GitHub] [pulsar] lifepuzzlefun commented on pull request #20577: [fix] [bookie] Enable kv logs in log4j configuration

lifepuzzlefun commented on PR #20577:
URL: https://github.com/apache/pulsar/pull/20577#issuecomment-1593146291

   @hangc0276 hi, can we only apply this config to mdc logger like below, most of pulsar logger did not use mdc 
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <Configuration status="WARN">
       <Appenders>
           <Console name="Console" target="SYSTEM_OUT">
               <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
           </Console>
           <Console name="ConsoleWithMDC" target="SYSTEM_OUT">
               <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %X{myKey} - %msg%n"/>
           </Console>
       </Appenders>
       <Loggers>
           <Logger name="com.mycompany.ClassWithoutMDC" level="info" additivity="false">
               <AppenderRef ref="Console"/>
           </Logger>
           <Logger name="com.mycompany.ClassWithMDC" level="info" additivity="false">
               <AppenderRef ref="ConsoleWithMDC"/>
           </Logger>
           <Root level="error">
               <AppenderRef ref="Console"/>
           </Root>
       </Loggers>
   </Configuration>
   ```


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