imaffe edited a comment on issue #2091:
URL: https://github.com/apache/rocketmq/issues/2091#issuecomment-647877363


   @heshengjun811 you can try add this to your logback.xml
   ```
       <appender name="mqAsyncAppender1" 
class="ch.qos.logback.classic.AsyncAppender">
           <queueSize>1024</queueSize>
           <discardingThreshold>80</discardingThreshold>
           <maxFlushTime>2000</maxFlushTime>
           <neverBlock>true</neverBlock>
           <appender-ref ref="mqAppender1"/>
       </appender>
   ``` 
   according to [logback 
example](https://rocketmq.apache.org/docs/logappender-example/)
   
   The whole logback.xml looks like 
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <configuration>
       <appender name="mqAppender1" 
class="org.apache.rocketmq.logappender.logback.RocketmqLogbackAppender">
           <tag>TagA</tag>
           <topic>01_test</topic>
           <producerGroup>group1</producerGroup>
           <nameServerAddress>127.0.0.1:9876</nameServerAddress>
           <layout>
               <pattern>%date %p %t - %m%n</pattern>
           </layout>
       </appender>
       <appender name="mqAsyncAppender1" 
class="ch.qos.logback.classic.AsyncAppender">
           <queueSize>1024</queueSize>
           <discardingThreshold>80</discardingThreshold>
           <maxFlushTime>2000</maxFlushTime>
           <neverBlock>true</neverBlock>
           <appender-ref ref="mqAppender1"/>
       </appender>
       <root>
           <level value="debug"/>
           <appender-ref ref="mqAppender1"/>
       </root>
       <logger name="testLogger" level="debug" additivity="true">
           <appender-ref ref="mqAppender1"/>
       </logger>
   </configuration>
   ```
   
   Once I added this, it will work properly. The reason for 
NoClassDefFoundError was because we missed some configuration entries, the 
static initialization process of some class (I don't know which exact class it 
is) failed, and throws NoClassDefFoundError.


----------------------------------------------------------------
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:
[email protected]


Reply via email to