You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/03 07:51:14 UTC

[GitHub] [skywalking] killGC opened a new issue #6314: where set “allArguments[0]” to EnhancedInstance class at logback async ?

killGC opened a new issue #6314:
URL: https://github.com/apache/skywalking/issues/6314


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   package org.apache.skywalking.apm.toolkit.activation.log.logback.v1.x.async;
   
   import org.apache.skywalking.apm.agent.core.context.ContextManager;
   import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
   import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
   import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
   
   import java.lang.reflect.Method;
   
   public class AsyncAppenderBaseMethodInterceptor implements InstanceMethodsAroundInterceptor {
   
       @Override
       public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
           MethodInterceptResult result) throws Throwable {
           if (**allArguments[0] instanceof EnhancedInstance**) {
               EnhancedInstance instances = (EnhancedInstance) allArguments[0];
               instances.setSkyWalkingDynamicField(ContextManager.getGlobalTraceId());
           }
       }
   
       @Override
       public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
           Object ret) throws Throwable {
           return ret;
       }
   
       @Override
       public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
           Class<?>[] argumentsTypes, Throwable t) {
       }
   }
   
   which class set allArguments[0] to EnhancedInstance ?
   ___
   ### Bug
   - Which version of SkyWalking, OS, and JRE?
   
   - Which company or project?
   
   - What happened?
   If possible, provide a way to reproduce the error. e.g. demo application, component version.
   
   ___
   ### Requirement or improvement
   - Please describe your requirements or improvement suggestions.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #6314: where set “allArguments[0]” to EnhancedInstance class at logback async ?

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6314:
URL: https://github.com/apache/skywalking/issues/6314


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #6314: where set “allArguments[0]” to EnhancedInstance class at logback async ?

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6314:
URL: https://github.com/apache/skywalking/issues/6314#issuecomment-772311523


   Sorry, please don't expect the community to explain the codes in the issue. It is unaffordable. Simple answer is, any class enhanced by SkyWalking's plugin, then its objects are implementing EnhancedInstance automatically.


----------------------------------------------------------------
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:
users@infra.apache.org