Search in sources :

Example 1 with PLogger

use of com.navercorp.pinpoint.bootstrap.logging.PLogger in project pinpoint by naver.

the class DefaultAgent method bindPLoggerFactory.

private void bindPLoggerFactory(PLoggerBinder binder) {
    final String binderClassName = binder.getClass().getName();
    PLogger pLogger = binder.getLogger(binder.getClass().getName());
    pLogger.info("PLoggerFactory.initialize() bind:{} cl:{}", binderClassName, binder.getClass().getClassLoader());
    // Set binder to static LoggerFactory
    // Should we unset binder at shutdown hook or stop()?
    PLoggerFactory.initialize(binder);
}
Also used : PLogger(com.navercorp.pinpoint.bootstrap.logging.PLogger)

Example 2 with PLogger

use of com.navercorp.pinpoint.bootstrap.logging.PLogger in project pinpoint by naver.

the class GrpcUtils method addServerListenerMethod.

public static void addServerListenerMethod(InstrumentClass target, boolean traceOnMessage) throws InstrumentException {
    List<InstrumentMethod> declaredMethods = target.getDeclaredMethods();
    for (InstrumentMethod declaredMethod : declaredMethods) {
        if (declaredMethod.getName().equals("onMessage") && !traceOnMessage) {
            PLogger logger = PLoggerFactory.getLogger(GrpcUtils.class.getName());
            logger.debug("skip add onMessage interceptor");
            continue;
        }
        if (declaredMethod.getName().equals("onHalfClose")) {
            declaredMethod.addInterceptor(ServerHalfCloseListenerInterceptor.class);
            continue;
        }
        declaredMethod.addInterceptor(ServerListenerInterceptor.class);
    }
}
Also used : InstrumentMethod(com.navercorp.pinpoint.bootstrap.instrument.InstrumentMethod) PLogger(com.navercorp.pinpoint.bootstrap.logging.PLogger)

Example 3 with PLogger

use of com.navercorp.pinpoint.bootstrap.logging.PLogger in project pinpoint by naver.

the class GrpcUtils method addStartCallMethodInterceptor.

public static void addStartCallMethodInterceptor(InstrumentClass target) throws InstrumentException {
    InstrumentMethod startCall = target.getDeclaredMethod("startCall", "io.grpc.ServerCall", "io.grpc.Metadata");
    if (startCall != null) {
        startCall.addInterceptor(CopyAsyncContextInterceptor.class);
    } else {
        PLogger logger = PLoggerFactory.getLogger(GrpcUtils.class.getName());
        logger.debug("can't find startCall method");
    }
}
Also used : InstrumentMethod(com.navercorp.pinpoint.bootstrap.instrument.InstrumentMethod) PLogger(com.navercorp.pinpoint.bootstrap.logging.PLogger)

Example 4 with PLogger

use of com.navercorp.pinpoint.bootstrap.logging.PLogger in project pinpoint by naver.

the class Log4j2Binder method getLogger.

@Override
public PLogger getLogger(String name) {
    final PLogger hitPLogger = loggerCache.get(name);
    if (hitPLogger != null) {
        return hitPLogger;
    }
    ExtendedLogger logger = loggerContext.getLogger(name);
    PLogger log4j2Adapter = new Log4j2PLoggerAdapter(logger);
    final PLogger before = loggerCache.putIfAbsent(name, log4j2Adapter);
    if (before != null) {
        return before;
    }
    return log4j2Adapter;
}
Also used : ExtendedLogger(org.apache.logging.log4j.spi.ExtendedLogger) PLogger(com.navercorp.pinpoint.bootstrap.logging.PLogger)

Example 5 with PLogger

use of com.navercorp.pinpoint.bootstrap.logging.PLogger in project pinpoint by naver.

the class Slf4jLoggerBinder method getLogger.

@Override
public PLogger getLogger(String name) {
    final PLogger hitPLogger = loggerCache.get(name);
    if (hitPLogger != null) {
        return hitPLogger;
    }
    org.slf4j.Logger slf4jLogger = LoggerFactory.getLogger(name);
    final Slf4jPLoggerAdapter slf4jLoggerAdapter = new Slf4jPLoggerAdapter(slf4jLogger);
    final PLogger before = loggerCache.putIfAbsent(name, slf4jLoggerAdapter);
    if (before != null) {
        return before;
    }
    return slf4jLoggerAdapter;
}
Also used : PLogger(com.navercorp.pinpoint.bootstrap.logging.PLogger)

Aggregations

PLogger (com.navercorp.pinpoint.bootstrap.logging.PLogger)9 InstrumentMethod (com.navercorp.pinpoint.bootstrap.instrument.InstrumentMethod)3 WriteConcern (com.mongodb.WriteConcern)1 Field (java.lang.reflect.Field)1 HashMap (java.util.HashMap)1 ServletRequest (javax.servlet.ServletRequest)1 ServletResponse (javax.servlet.ServletResponse)1 ExtendedLogger (org.apache.logging.log4j.spi.ExtendedLogger)1 Before (org.junit.Before)1