提交 137906b6 编写于 作者: C c feng

Optimize the plug-in load hints

上级 be32ab22
...@@ -27,7 +27,7 @@ public class PluginBootstrap { ...@@ -27,7 +27,7 @@ public class PluginBootstrap {
List<URL> resources = resolver.getResources(); List<URL> resources = resolver.getResources();
if (resources == null || resources.size() == 0) { if (resources == null || resources.size() == 0) {
logger.info("no plugin files (skywalking-plugin.properties) found, continue to start application."); logger.info("no plugin files (skywalking-plugin.def) found, continue to start application.");
return new ArrayList<AbstractClassEnhancePluginDefine>(); return new ArrayList<AbstractClassEnhancePluginDefine>();
} }
...@@ -35,7 +35,7 @@ public class PluginBootstrap { ...@@ -35,7 +35,7 @@ public class PluginBootstrap {
try { try {
PluginCfg.INSTANCE.load(pluginUrl.openStream()); PluginCfg.INSTANCE.load(pluginUrl.openStream());
} catch (Throwable t) { } catch (Throwable t) {
logger.error(t, "plugin [{}] init failure.", pluginUrl); logger.error(t, "plugin file [{}] init failure.", pluginUrl);
} }
} }
......
package org.skywalking.apm.agent.core.plugin; package org.skywalking.apm.agent.core.plugin;
import org.skywalking.apm.agent.core.plugin.exception.IllegalPluginDefineException;
import org.skywalking.apm.logging.ILog;
import org.skywalking.apm.logging.LogManager;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.skywalking.apm.agent.core.plugin.exception.IllegalPluginDefineException;
import org.skywalking.apm.logging.ILog;
import org.skywalking.apm.logging.LogManager;
public enum PluginCfg { public enum PluginCfg {
INSTANCE; INSTANCE;
...@@ -31,7 +32,7 @@ public enum PluginCfg { ...@@ -31,7 +32,7 @@ public enum PluginCfg {
pluginClassList.add(plugin); pluginClassList.add(plugin);
} }
} catch (IllegalPluginDefineException e) { } catch (IllegalPluginDefineException e) {
logger.error("Failed to format plugin define.", e); logger.error(e,"Failed to format plugin({}) define.", pluginDefine);
} }
} }
} finally { } finally {
......
...@@ -24,10 +24,6 @@ public class PluginResourcesResolver { ...@@ -24,10 +24,6 @@ public class PluginResourcesResolver {
try { try {
urls = getDefaultClassLoader().getResources("skywalking-plugin.def"); urls = getDefaultClassLoader().getResources("skywalking-plugin.def");
if (!urls.hasMoreElements()) {
logger.info("no plugin files (skywalking-plugin.def) found");
}
while (urls.hasMoreElements()) { while (urls.hasMoreElements()) {
URL pluginUrl = urls.nextElement(); URL pluginUrl = urls.nextElement();
cfgUrlPaths.add(pluginUrl); cfgUrlPaths.add(pluginUrl);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册