Skip to content

Commit

Permalink
Merge pull request #1394 from minwoo-jung/issue-1303
Browse files Browse the repository at this point in the history
[#1303]Improved logic for checking if log4j logback can be modified
  • Loading branch information
minwoo-jung committed Dec 31, 2015
2 parents e73bfe7 + 7b686f8 commit e878e39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit e878e39

Please sign in to comment.