Search in sources :

Example 6 with PLogger

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

the class ServletArgumentValidatorTest method setUp.

@Before
public void setUp() throws Exception {
    PLogger logger = PLoggerFactory.getLogger(this.getClass());
    this.validator = new ServletArgumentValidator(logger, 0, ServletRequest.class, 1, ServletResponse.class);
}
Also used : ServletRequest(javax.servlet.ServletRequest) ServletResponse(javax.servlet.ServletResponse) PLogger(com.navercorp.pinpoint.bootstrap.logging.PLogger) Before(org.junit.Before)

Example 7 with PLogger

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

the class GrpcUtils method addNewCallMethodInterceptor.

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

Example 8 with PLogger

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

the class Log4j2LoggingSystem 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 9 with PLogger

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

the class MongoWriteConcernMapper method buildWriteConcern.

private Map<WriteConcern, String> buildWriteConcern() {
    Map<WriteConcern, String> writeConcernMap = new HashMap<>();
    for (final Field f : WriteConcern.class.getFields()) {
        if (Modifier.isStatic(f.getModifiers()) && f.getType().equals(WriteConcern.class) && f.getAnnotation(Deprecated.class) == null) {
            String value = f.getName();
            try {
                WriteConcern key = (WriteConcern) f.get(null);
                writeConcernMap.put(key, value);
            } catch (IllegalAccessException e) {
                PLogger logger = PLoggerFactory.getLogger(this.getClass());
                logger.warn("WriteConcern access error Caused by:" + e.getMessage(), e);
            }
        }
    }
    return writeConcernMap;
}
Also used : Field(java.lang.reflect.Field) HashMap(java.util.HashMap) WriteConcern(com.mongodb.WriteConcern) 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