APISonar


org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan.log

> org > apache > skywalking > apm > agent > core > context > trace > AbstractSpan > log
org APIs apache APIs skywalking APIs apm APIs agent APIs core APIs context APIs trace APIs AbstractSpan APIs log APIs

Example 1
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
        Class<?>[] argumentsTypes, Throwable t) {
        AbstractSpan abstractSpan = ContextManager.activeSpan();
        abstractSpan.errorOccurred();
        abstractSpan.log(t);
    }
Example 2
@Override public void beforeMethod(Class clazz, Method method, Object[] allArguments, Class<?>[] parameterTypes,
                                       MethodInterceptResult result) {
        AbstractSpan activeSpan = null;
        try {
            activeSpan = ContextManager.activeSpan();
            Map<String, String> event = new HashMap<String, String>();
            event.put("event", "info");
            event.put("message", String.valueOf(allArguments[0]));
            activeSpan.log(System.currentTimeMillis(), event);

        } catch (NullPointerException e) {
        }
    }
Example 3
@Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
        Class<?>[] argumentsTypes, Object ret) throws Throwable {
        Response response = (Response)ret;
        if (response != null && response.getException() != null) {
            AbstractSpan span = ContextManager.activeSpan();
            span.errorOccurred();
            span.log(response.getException());
        }
        ContextManager.stopSpan();
        return ret;
    }
Example 4
private void dealException(Throwable throwable) {
        AbstractSpan span = ContextManager.activeSpan();
        span.errorOccurred();
        span.log(throwable);
    }
Example 5
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        MethodInterceptResult result) throws Throwable {
        if (ContextManager.isActive()) {
            AbstractSpan abstractTracingSpan = ContextManager.activeSpan();
            Map<String, String> eventMap = new HashMap<String, String>();
            eventMap.put("forward-url", objInst.getSkyWalkingDynamicField() == null ? "" : String.valueOf(objInst.getSkyWalkingDynamicField()));
            abstractTracingSpan.log(System.currentTimeMillis(), eventMap);
            ContextManager.getRuntimeContext().put(Constants.FORWARD_REQUEST_FLAG, true);
        }
    }