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);
}
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);
}
}
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");
}
}
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;
}
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;
}
Aggregations