Fix how we evaluate if customlogger is on classpath

Resources must replace `.` -> `/` and add `.class` to the end.
This commit is contained in:
Tyler Benson 2019-02-15 15:00:25 -08:00
parent 2d0636e158
commit 8512b841e6
2 changed files with 5 additions and 2 deletions

View File

@ -276,7 +276,8 @@ public class TracingAgent {
final String logManagerProp = System.getProperty("java.util.logging.manager");
if (logManagerProp != null) {
final boolean onSysClasspath = ClassLoader.getSystemResource(logManagerProp) != null;
final boolean onSysClasspath =
ClassLoader.getSystemResource(logManagerProp.replaceAll("\\.", "/") + ".class") != null;
if (debugEnabled) {
System.out.println("Prop - logging.manager: " + logManagerProp);
System.out.println("logging.manager on system classpath: " + onSysClasspath);

View File

@ -20,7 +20,9 @@ public class LogManagerSetter {
"jmxfetch should start in premain when customlogmanager=false.");
}
} else if (System.getProperty("java.util.logging.manager") != null) {
if (ClassLoader.getSystemResource(System.getProperty("java.util.logging.manager")) == null) {
if (ClassLoader.getSystemResource(
System.getProperty("java.util.logging.manager").replaceAll("\\.", "/") + ".class")
== null) {
customAssert(
isJmxfetchStarted(),
false,