YczYanchengzhe opened a new issue #5891:
URL: https://github.com/apache/skywalking/issues/5891


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [x] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   We're using grpc to report TraceInfo.Find a problem .If the log 
configuration of the business starts slowly.Only error level printout of the 
log will occur .
   Through our observation . That's because he used netty acquisition channel 
in the grpc thread . problem class is [io.grpc.internal] , version is[grpc 
-core -1.26.0]
   ` private static final Logger log = 
Logger.getLogger(GrpcUtil.class.getName());` Here's the log  use .
   
   test code is : 
   ```java
   import org.apache.logging.log4j.core.config.ConfigurationSource;
   import org.apache.logging.log4j.core.config.Configurator;
   import org.slf4j.Logger;
   import org.slf4j.LoggerFactory;
   
   import java.io.FileInputStream;
   import java.io.IOException;
   
       public static void main(String[] args) throws InterruptedException, 
IOException {
           System.out.println("start test");
           Thread.sleep(5000);
           // path can't resources 
           ConfigurationSource source = new ConfigurationSource(new 
FileInputStream("/opt/log.xml"));
           Configurator.initialize((ClassLoader)null, source);
           Logger LOGGER =LoggerFactory.getLogger(TxMDC.class);
           // this log only print error 
           LOGGER.info("main thread start");
       }
   ```
   test pom is
   ```xml
   
   <dependencies>
           <!-- 日志 log4j2-->
           <dependency>
               <groupId>org.apache.logging.log4j</groupId>
               <artifactId>log4j-core</artifactId>
               <version>2.3</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.logging.log4j</groupId>
               <artifactId>log4j-slf4j-impl</artifactId>
               <version>2.3</version>
           </dependency>
           <!--slf4j-->
           <dependency>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-api</artifactId>
               <version>1.7.21</version>
           </dependency>
           
       </dependencies>
   ```
   
   
   
   error place : 
   ```java
   System.out.println("test ---> 8");
                           managedChannel = 
GRPCChannel.newBuilder(ipAndPort[0], Integer.parseInt(ipAndPort[1]))
                                                       
.addManagedChannelBuilder(new StandardChannelBuilder())
                                                       
.addManagedChannelBuilder(new TLSChannelBuilder())
                                                       .addChannelDecorator(new 
AgentIDDecorator())
                                                       .addChannelDecorator(new 
AuthenticationDecorator())
                                                       .build();
                           System.out.println("test ---> 9");
                           notify(GRPCChannelStatus.CONNECTED);
                           System.out.println("test ---> 10");
   ```
   
   By increasing grpc thread startup time, we solve this problem  , I would 
like to know if there are any other solutions 
   ___
   ### Requirement or improvement
   JDK : 1.8
   skywalking : 8.1 
   


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