diff --git a/plugins/log4j/src/main/java/com/navercorp/pinpoint/plugin/log4j/Log4jPlugin.java b/plugins/log4j/src/main/java/com/navercorp/pinpoint/plugin/log4j/Log4jPlugin.java index 8695e9d3c31b..bf88ed6d2865 100644 --- a/plugins/log4j/src/main/java/com/navercorp/pinpoint/plugin/log4j/Log4jPlugin.java +++ b/plugins/log4j/src/main/java/com/navercorp/pinpoint/plugin/log4j/Log4jPlugin.java @@ -69,16 +69,19 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin logger.warn("Can not modify. Because constructor to modify not exist at org.apache.log4j.MDC class." + "\nThere is a strong presumption that your application use under version 1.2.14 log4j." + "\nconstructor prototype : LoggingEvent(String fqnOfCategoryClass, Category logger, Priority level, Object message, Throwable throwable);"); + return null; } if (!target.hasConstructor("java.lang.String", "org.apache.log4j.Category", "long", "org.apache.log4j.Priority", "java.lang.Object", "java.lang.Throwable")) { logger.warn("Can not modify. Because constructor to modify not exist at org.apache.log4j.MDC class." + "\nThere is a strong presumption that your application use under version 1.2.14 log4j." + "\nconstructor prototype : LoggingEvent(String fqnOfCategoryClass, Category logger, long timeStamp, Priority level, Object message, Throwable throwable);"); + return null; } if (!target.hasConstructor("java.lang.String", "org.apache.log4j.Category", "long", "org.apache.log4j.Level", "java.lang.Object", "java.lang.String", "org.apache.log4j.spi.ThrowableInformation", "java.lang.String", "org.apache.log4j.spi.LocationInfo", "java.util.Map")) { logger.warn("Can not modify. Because constructor to modify not exist at org.apache.log4j.MDC class. " + "\nThere is a strong presumption that your application use under version 1.2.14 log4j." + "\nconstructor prototype : LoggingEvent(final String fqnOfCategoryClass, final Category logger, final long timeStamp, final Level level, final Object message, final String threadName, final ThrowableInformation throwable, final String ndc, final LocationInfo info, final java.util.Map properties);"); + return null; } target.addInterceptor("com.navercorp.pinpoint.plugin.log4j.interceptor.LoggingEventOfLog4jInterceptor"); diff --git a/plugins/logback/src/main/java/com/navercorp/pinpoint/plugin/logback/LogbackPlugin.java b/plugins/logback/src/main/java/com/navercorp/pinpoint/plugin/logback/LogbackPlugin.java index 21c6b78e84b3..6cf52c47a520 100644 --- a/plugins/logback/src/main/java/com/navercorp/pinpoint/plugin/logback/LogbackPlugin.java +++ b/plugins/logback/src/main/java/com/navercorp/pinpoint/plugin/logback/LogbackPlugin.java @@ -69,10 +69,12 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin if (!target.hasConstructor()) { logger.warn("Can not modify. Because constructor to modify not exist at ch.qos.logback.classic.spi.LoggingEvent class." + "\nconstructor prototype : LoggingEvent();"); + return null; } if (!target.hasConstructor("java.lang.String", "ch.qos.logback.classic.Logger", "ch.qos.logback.classic.Level", "java.lang.String", "java.lang.Throwable", "java.lang.Object[]")) { logger.warn("Can not modify. Because constructor to modify not exist at ch.qos.logback.classic.spi.LoggingEvent class." + "\nconstructor prototype : LoggingEvent(String fqcn, Logger logger, Level level, String message, Throwable throwable, Object[] argArray);"); + return null; } target.addInterceptor("com.navercorp.pinpoint.plugin.logback.interceptor.LoggingEventOfLogbackInterceptor");