未验证 提交 5bfac1b5 编写于 作者: L Lu Jiajing 提交者: GitHub

Remove style-check exception for logger (#5363)

上级 79c1c0cc
......@@ -79,7 +79,7 @@
<!--Checks that long constants are defined with an upper ell-->
<module name="UpperEll"/>
<module name="ConstantName">
<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)|(^logger)"/>
<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)"/>
</module>
<!--Checks that local, non-final variable names conform to producerGroup format specified by the format property-->
<module name="LocalVariableName"/>
......
......@@ -28,15 +28,12 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.logging.Logger;
/**
* Init a class's static fields by a {@link Properties}, including static fields and static inner classes.
* <p>
*/
public class ConfigInitializer {
private static final Logger logger = Logger.getLogger(ConfigInitializer.class.getName());
public static void initialize(Properties properties, Class<?> rootConfigType) throws IllegalAccessException {
initNextLevel(properties, rootConfigType, new ConfigDesc());
}
......
......@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* mechanism fails, the agent will exit directly.
*/
public class AgentPackagePath {
private static final ILog logger = LogManager.getLogger(AgentPackagePath.class);
private static final ILog LOGGER = LogManager.getLogger(AgentPackagePath.class);
private static File AGENT_PACKAGE_PATH;
......@@ -53,7 +53,7 @@ public class AgentPackagePath {
if (resource != null) {
String urlString = resource.toString();
logger.debug("The beacon class location is {}.", urlString);
LOGGER.debug("The beacon class location is {}.", urlString);
int insidePathIndex = urlString.indexOf('!');
boolean isInJar = insidePathIndex > -1;
......@@ -64,7 +64,7 @@ public class AgentPackagePath {
try {
agentJarFile = new File(new URL(urlString).toURI());
} catch (MalformedURLException | URISyntaxException e) {
logger.error(e, "Can not locate agent jar file by url:" + urlString);
LOGGER.error(e, "Can not locate agent jar file by url:" + urlString);
}
if (agentJarFile.exists()) {
return agentJarFile.getParentFile();
......@@ -77,7 +77,7 @@ public class AgentPackagePath {
}
}
logger.error("Can not locate agent jar file.");
LOGGER.error("Can not locate agent jar file.");
throw new AgentPackageNotFoundException("Can not locate agent jar file.");
}
......
......@@ -34,7 +34,7 @@ import org.apache.skywalking.apm.agent.core.plugin.loader.AgentClassLoader;
public enum ServiceManager {
INSTANCE;
private static final ILog logger = LogManager.getLogger(ServiceManager.class);
private static final ILog LOGGER = LogManager.getLogger(ServiceManager.class);
private Map<Class, BootService> bootedServices = Collections.emptyMap();
public void boot() {
......@@ -50,7 +50,7 @@ public enum ServiceManager {
try {
service.shutdown();
} catch (Throwable e) {
logger.error(e, "ServiceManager try to shutdown [{}] fail.", service.getClass().getName());
LOGGER.error(e, "ServiceManager try to shutdown [{}] fail.", service.getClass().getName());
}
}
}
......@@ -103,7 +103,7 @@ public enum ServiceManager {
try {
service.prepare();
} catch (Throwable e) {
logger.error(e, "ServiceManager try to pre-start [{}] fail.", service.getClass().getName());
LOGGER.error(e, "ServiceManager try to pre-start [{}] fail.", service.getClass().getName());
}
}
}
......@@ -113,7 +113,7 @@ public enum ServiceManager {
try {
service.boot();
} catch (Throwable e) {
logger.error(e, "ServiceManager try to start [{}] fail.", service.getClass().getName());
LOGGER.error(e, "ServiceManager try to start [{}] fail.", service.getClass().getName());
}
}
}
......@@ -123,7 +123,7 @@ public enum ServiceManager {
try {
service.onComplete();
} catch (Throwable e) {
logger.error(e, "Service [{}] AfterBoot process fails.", service.getClass().getName());
LOGGER.error(e, "Service [{}] AfterBoot process fails.", service.getClass().getName());
}
}
}
......
......@@ -40,7 +40,7 @@ import org.apache.skywalking.apm.util.StringUtil;
* The <code>SnifferConfigInitializer</code> initializes all configs in several way.
*/
public class SnifferConfigInitializer {
private static final ILog logger = LogManager.getLogger(SnifferConfigInitializer.class);
private static final ILog LOGGER = LogManager.getLogger(SnifferConfigInitializer.class);
private static final String SPECIFIED_CONFIG_PATH = "skywalking_config";
private static final String DEFAULT_CONFIG_FILE_NAME = "/config/agent.config";
private static final String ENV_KEY_PREFIX = "skywalking.";
......@@ -68,24 +68,24 @@ public class SnifferConfigInitializer {
}
} catch (Exception e) {
logger.error(e, "Failed to read the config file, skywalking is going to run in default config.");
LOGGER.error(e, "Failed to read the config file, skywalking is going to run in default config.");
}
try {
overrideConfigBySystemProp();
} catch (Exception e) {
logger.error(e, "Failed to read the system properties.");
LOGGER.error(e, "Failed to read the system properties.");
}
agentOptions = StringUtil.trim(agentOptions, ',');
if (!StringUtil.isEmpty(agentOptions)) {
try {
agentOptions = agentOptions.trim();
logger.info("Agent options is {}.", agentOptions);
LOGGER.info("Agent options is {}.", agentOptions);
overrideConfigByAgentOptions(agentOptions);
} catch (Exception e) {
logger.error(e, "Failed to parse the agent options, val is {}.", agentOptions);
LOGGER.error(e, "Failed to parse the agent options, val is {}.", agentOptions);
}
}
......@@ -98,7 +98,7 @@ public class SnifferConfigInitializer {
throw new ExceptionInInitializerError("`collector.backend_service` is missing.");
}
if (Config.Plugin.PEER_MAX_LENGTH <= 3) {
logger.warn(
LOGGER.warn(
"PEER_MAX_LENGTH configuration:{} error, the default value of 200 will be used.",
Config.Plugin.PEER_MAX_LENGTH
);
......@@ -115,13 +115,13 @@ public class SnifferConfigInitializer {
*/
public static void initializeConfig(Class configClass) {
if (AGENT_SETTINGS == null) {
logger.error("Plugin configs have to be initialized after core config initialization.");
LOGGER.error("Plugin configs have to be initialized after core config initialization.");
return;
}
try {
ConfigInitializer.initialize(AGENT_SETTINGS, configClass);
} catch (IllegalAccessException e) {
logger.error(e,
LOGGER.error(e,
"Failed to set the agent settings {}"
+ " to Config={} ",
AGENT_SETTINGS, configClass
......@@ -198,7 +198,7 @@ public class SnifferConfigInitializer {
if (configFile.exists() && configFile.isFile()) {
try {
logger.info("Config file found in {}.", configFile);
LOGGER.info("Config file found in {}.", configFile);
return new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8);
} catch (FileNotFoundException e) {
......
......@@ -38,7 +38,7 @@ import static org.apache.skywalking.apm.agent.core.conf.Config.Agent.OPERATION_N
* <p> Also, {@link ContextManager} delegates to all {@link AbstractTracerContext}'s major methods.
*/
public class ContextManager implements BootService {
private static final ILog logger = LogManager.getLogger(ContextManager.class);
private static final ILog LOGGER = LogManager.getLogger(ContextManager.class);
private static ThreadLocal<AbstractTracerContext> CONTEXT = new ThreadLocal<AbstractTracerContext>();
private static ThreadLocal<RuntimeContext> RUNTIME_CONTEXT = new ThreadLocal<RuntimeContext>();
private static ContextManagerExtendService EXTEND_SERVICE;
......@@ -47,8 +47,8 @@ public class ContextManager implements BootService {
AbstractTracerContext context = CONTEXT.get();
if (context == null) {
if (StringUtil.isEmpty(operationName)) {
if (logger.isDebugEnable()) {
logger.debug("No operation name, ignore this trace.");
if (LOGGER.isDebugEnable()) {
LOGGER.debug("No operation name, ignore this trace.");
}
context = new IgnoredTracerContext();
} else {
......
......@@ -55,7 +55,7 @@ import org.apache.skywalking.apm.util.StringUtil;
* ContextCarrier} or {@link ContextSnapshot}.
*/
public class TracingContext implements AbstractTracerContext {
private static final ILog logger = LogManager.getLogger(TracingContext.class);
private static final ILog LOGGER = LogManager.getLogger(TracingContext.class);
private long lastWarningTimestamp = 0;
/**
......@@ -559,7 +559,7 @@ public class TracingContext implements AbstractTracerContext {
if (spanIdGenerator >= Config.Agent.SPAN_LIMIT_PER_SEGMENT) {
long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis - lastWarningTimestamp > 30 * 1000) {
logger.warn(
LOGGER.warn(
new RuntimeException("Shadow tracing context. Thread dump"),
"More than {} spans required to create", Config.Agent.SPAN_LIMIT_PER_SEGMENT
);
......
......@@ -41,7 +41,7 @@ import static org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UP
@DefaultImplementor
public class JVMMetricsSender implements BootService, Runnable, GRPCChannelListener {
private static final ILog logger = LogManager.getLogger(JVMMetricsSender.class);
private static final ILog LOGGER = LogManager.getLogger(JVMMetricsSender.class);
private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT;
private volatile JVMMetricReportServiceGrpc.JVMMetricReportServiceBlockingStub stub = null;
......@@ -83,7 +83,7 @@ public class JVMMetricsSender implements BootService, Runnable, GRPCChannelListe
ServiceManager.INSTANCE.findService(CommandService.class).receiveCommand(commands);
}
} catch (Throwable t) {
logger.error(t, "send JVM metrics to Collector fail.");
LOGGER.error(t, "send JVM metrics to Collector fail.");
}
}
}
......
......@@ -42,7 +42,7 @@ import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
*/
@DefaultImplementor
public class JVMService implements BootService, Runnable {
private static final ILog logger = LogManager.getLogger(JVMService.class);
private static final ILog LOGGER = LogManager.getLogger(JVMService.class);
private volatile ScheduledFuture<?> collectMetricFuture;
private volatile ScheduledFuture<?> sendMetricFuture;
private JVMMetricsSender sender;
......@@ -61,7 +61,7 @@ public class JVMService implements BootService, Runnable {
new RunnableWithExceptionProtection.CallbackWhenException() {
@Override
public void handle(Throwable t) {
logger.error("JVMService produces metrics failure.", t);
LOGGER.error("JVMService produces metrics failure.", t);
}
}
), 0, 1, TimeUnit.SECONDS);
......@@ -72,7 +72,7 @@ public class JVMService implements BootService, Runnable {
new RunnableWithExceptionProtection.CallbackWhenException() {
@Override
public void handle(Throwable t) {
logger.error("JVMService consumes and upload failure.", t);
LOGGER.error("JVMService consumes and upload failure.", t);
}
}
), 0, 1, TimeUnit.SECONDS);
......@@ -103,7 +103,7 @@ public class JVMService implements BootService, Runnable {
sender.offer(jvmBuilder.build());
} catch (Exception e) {
logger.error(e, "Collect JVM info fail.");
LOGGER.error(e, "Collect JVM info fail.");
}
}
}
......@@ -44,7 +44,7 @@ import static org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UP
@DefaultImplementor
public class MeterSender implements BootService, GRPCChannelListener {
private static final ILog logger = LogManager.getLogger(MeterSender.class);
private static final ILog LOGGER = LogManager.getLogger(MeterSender.class);
private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT;
......@@ -75,8 +75,8 @@ public class MeterSender implements BootService, GRPCChannelListener {
@Override
public void onError(Throwable throwable) {
status.finished();
if (logger.isErrorEnable()) {
logger.error(throwable, "Send meters to collector fail with a grpc internal exception.");
if (LOGGER.isErrorEnable()) {
LOGGER.error(throwable, "Send meters to collector fail with a grpc internal exception.");
}
ServiceManager.INSTANCE.findService(GRPCChannelManager.class).reportError(throwable);
}
......@@ -91,12 +91,12 @@ public class MeterSender implements BootService, GRPCChannelListener {
transform(meterMap, meterData -> reporter.onNext(meterData));
} catch (Throwable e) {
if (!(e instanceof StatusRuntimeException)) {
logger.error(e, "Report meters to backend fail.");
LOGGER.error(e, "Report meters to backend fail.");
return;
}
final StatusRuntimeException statusRuntimeException = (StatusRuntimeException) e;
if (statusRuntimeException.getStatus().getCode() == Status.Code.UNIMPLEMENTED) {
logger.warn("Backend doesn't support meter, it will be disabled");
LOGGER.warn("Backend doesn't support meter, it will be disabled");
meterService.shutdown();
}
......
......@@ -34,7 +34,7 @@ import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
@DefaultImplementor
public class MeterService implements BootService, Runnable {
private static final ILog logger = LogManager.getLogger(MeterService.class);
private static final ILog LOGGER = LogManager.getLogger(MeterService.class);
// all meters
private final ConcurrentHashMap<MeterId, MeterTransformer> meterMap = new ConcurrentHashMap<>();
......@@ -52,7 +52,7 @@ public class MeterService implements BootService, Runnable {
return;
}
if (meterMap.size() >= Config.Meter.MAX_METER_SIZE) {
logger.warn(
LOGGER.warn(
"Already out of the meter system max size, will not report. meter name:{}", meterTransformer.getName());
return;
}
......@@ -72,7 +72,7 @@ public class MeterService implements BootService, Runnable {
new DefaultNamedThreadFactory("MeterReportService")
).scheduleWithFixedDelay(new RunnableWithExceptionProtection(
this,
t -> logger.error("Report meters failure.", t)
t -> LOGGER.error("Report meters failure.", t)
), 0, Config.Meter.REPORT_INTERVAL, TimeUnit.SECONDS);
}
}
......
......@@ -25,7 +25,7 @@ import org.apache.skywalking.apm.network.language.agent.v3.MeterData;
import org.apache.skywalking.apm.network.language.agent.v3.MeterSingleValue;
public class GaugeTransformer extends MeterTransformer<GaugeAdapter> {
private static final ILog logger = LogManager.getLogger(GaugeTransformer.class);
private static final ILog LOGGER = LogManager.getLogger(GaugeTransformer.class);
public GaugeTransformer(GaugeAdapter adapter) {
super(adapter);
......@@ -38,7 +38,7 @@ public class GaugeTransformer extends MeterTransformer<GaugeAdapter> {
try {
count = adapter.getCount();
} catch (Exception e) {
logger.warn(e, "Cannot get the count in meter:{}", adapter.getId().getName());
LOGGER.warn(e, "Cannot get the count in meter:{}", adapter.getId().getName());
return null;
}
......
......@@ -36,7 +36,7 @@ import org.apache.skywalking.apm.util.StringUtil;
* {@link ClassEnhancePluginDefine}
*/
public abstract class AbstractClassEnhancePluginDefine {
private static final ILog logger = LogManager.getLogger(AbstractClassEnhancePluginDefine.class);
private static final ILog LOGGER = LogManager.getLogger(AbstractClassEnhancePluginDefine.class);
/**
* Main entrance of enhancing the class.
......@@ -52,11 +52,11 @@ public abstract class AbstractClassEnhancePluginDefine {
String interceptorDefineClassName = this.getClass().getName();
String transformClassName = typeDescription.getTypeName();
if (StringUtil.isEmpty(transformClassName)) {
logger.warn("classname of being intercepted is not defined by {}.", interceptorDefineClassName);
LOGGER.warn("classname of being intercepted is not defined by {}.", interceptorDefineClassName);
return null;
}
logger.debug("prepare to enhance class {} by {}.", transformClassName, interceptorDefineClassName);
LOGGER.debug("prepare to enhance class {} by {}.", transformClassName, interceptorDefineClassName);
/**
* find witness classes for enhance class
......@@ -65,7 +65,7 @@ public abstract class AbstractClassEnhancePluginDefine {
if (witnessClasses != null) {
for (String witnessClass : witnessClasses) {
if (!WitnessClassFinder.INSTANCE.exist(witnessClass, classLoader)) {
logger.warn("enhance class {} by plugin {} is not working. Because witness class {} is not existed.", transformClassName, interceptorDefineClassName, witnessClass);
LOGGER.warn("enhance class {} by plugin {} is not working. Because witness class {} is not existed.", transformClassName, interceptorDefineClassName, witnessClass);
return null;
}
}
......@@ -77,7 +77,7 @@ public abstract class AbstractClassEnhancePluginDefine {
DynamicType.Builder<?> newClassBuilder = this.enhance(typeDescription, builder, classLoader, context);
context.initializationStageCompleted();
logger.debug("enhance class {} by {} completely.", transformClassName, interceptorDefineClassName);
LOGGER.debug("enhance class {} by {} completely.", transformClassName, interceptorDefineClassName);
return newClassBuilder;
}
......
......@@ -34,7 +34,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
public enum InstrumentDebuggingClass {
INSTANCE;
private static final ILog logger = LogManager.getLogger(InstrumentDebuggingClass.class);
private static final ILog LOGGER = LogManager.getLogger(InstrumentDebuggingClass.class);
private File debuggingClassesRootPath;
public void log(DynamicType dynamicType) {
......@@ -54,17 +54,17 @@ public enum InstrumentDebuggingClass {
debuggingClassesRootPath.mkdir();
}
} catch (AgentPackageNotFoundException e) {
logger.error(e, "Can't find the root path for creating /debugging folder.");
LOGGER.error(e, "Can't find the root path for creating /debugging folder.");
}
}
try {
dynamicType.saveIn(debuggingClassesRootPath);
} catch (IOException e) {
logger.error(e, "Can't save class {} to file." + dynamicType.getTypeDescription().getActualName());
LOGGER.error(e, "Can't save class {} to file." + dynamicType.getTypeDescription().getActualName());
}
} catch (Throwable t) {
logger.error(t, "Save debugging classes fail.");
LOGGER.error(t, "Save debugging classes fail.");
}
}
}
......
......@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* definitions.
*/
public class PluginBootstrap {
private static final ILog logger = LogManager.getLogger(PluginBootstrap.class);
private static final ILog LOGGER = LogManager.getLogger(PluginBootstrap.class);
/**
* load all plugins.
......@@ -45,7 +45,7 @@ public class PluginBootstrap {
List<URL> resources = resolver.getResources();
if (resources == null || resources.size() == 0) {
logger.info("no plugin files (skywalking-plugin.def) found, continue to start application.");
LOGGER.info("no plugin files (skywalking-plugin.def) found, continue to start application.");
return new ArrayList<AbstractClassEnhancePluginDefine>();
}
......@@ -53,7 +53,7 @@ public class PluginBootstrap {
try {
PluginCfg.INSTANCE.load(pluginUrl.openStream());
} catch (Throwable t) {
logger.error(t, "plugin file [{}] init failure.", pluginUrl);
LOGGER.error(t, "plugin file [{}] init failure.", pluginUrl);
}
}
......@@ -62,12 +62,12 @@ public class PluginBootstrap {
List<AbstractClassEnhancePluginDefine> plugins = new ArrayList<AbstractClassEnhancePluginDefine>();
for (PluginDefine pluginDefine : pluginClassList) {
try {
logger.debug("loading plugin class {}.", pluginDefine.getDefineClass());
LOGGER.debug("loading plugin class {}.", pluginDefine.getDefineClass());
AbstractClassEnhancePluginDefine plugin = (AbstractClassEnhancePluginDefine) Class.forName(pluginDefine.getDefineClass(), true, AgentClassLoader
.getDefault()).newInstance();
plugins.add(plugin);
} catch (Throwable t) {
logger.error(t, "load plugin [{}] failure.", pluginDefine.getDefineClass());
LOGGER.error(t, "load plugin [{}] failure.", pluginDefine.getDefineClass());
}
}
......
......@@ -32,7 +32,7 @@ import java.util.List;
public enum PluginCfg {
INSTANCE;
private static final ILog logger = LogManager.getLogger(PluginCfg.class);
private static final ILog LOGGER = LogManager.getLogger(PluginCfg.class);
private List<PluginDefine> pluginClassList = new ArrayList<PluginDefine>();
private PluginSelector pluginSelector = new PluginSelector();
......@@ -49,7 +49,7 @@ public enum PluginCfg {
PluginDefine plugin = PluginDefine.build(pluginDefine);
pluginClassList.add(plugin);
} catch (IllegalPluginDefineException e) {
logger.error(e, "Failed to format plugin({}) define.", pluginDefine);
LOGGER.error(e, "Failed to format plugin({}) define.", pluginDefine);
}
}
pluginClassList = pluginSelector.select(pluginClassList);
......
......@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.agent.core.plugin.loader.AgentClassLoader;
* Use the current classloader to read all plugin define file. The file must be named 'skywalking-plugin.def'
*/
public class PluginResourcesResolver {
private static final ILog logger = LogManager.getLogger(PluginResourcesResolver.class);
private static final ILog LOGGER = LogManager.getLogger(PluginResourcesResolver.class);
public List<URL> getResources() {
List<URL> cfgUrlPaths = new ArrayList<URL>();
......@@ -42,12 +42,12 @@ public class PluginResourcesResolver {
while (urls.hasMoreElements()) {
URL pluginUrl = urls.nextElement();
cfgUrlPaths.add(pluginUrl);
logger.info("find skywalking plugin define in {}", pluginUrl);
LOGGER.info("find skywalking plugin define in {}", pluginUrl);
}
return cfgUrlPaths;
} catch (IOException e) {
logger.error("read resources failure.", e);
LOGGER.error("read resources failure.", e);
}
return null;
}
......
......@@ -52,7 +52,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
* classes into bootstrap class loader, including generated dynamic delegate classes.
*/
public class BootstrapInstrumentBoost {
private static final ILog logger = LogManager.getLogger(BootstrapInstrumentBoost.class);
private static final ILog LOGGER = LogManager.getLogger(BootstrapInstrumentBoost.class);
private static final String[] HIGH_PRIORITY_CLASSES = {
"org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist",
......
......@@ -46,7 +46,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class CacheableTransformerDecorator implements AgentBuilder.TransformerDecorator {
private static final ILog logger = LogManager.getLogger(CacheableTransformerDecorator.class);
private static final ILog LOGGER = LogManager.getLogger(CacheableTransformerDecorator.class);
private final ClassCacheMode cacheMode;
private ClassCacheResolver cacheResolver;
......@@ -163,7 +163,7 @@ public class CacheableTransformerDecorator implements AgentBuilder.TransformerDe
fileInputStream = new FileInputStream(cacheFile);
return IOUtils.toByteArray(fileInputStream);
} catch (IOException e) {
logger.error("load class bytes from cache file failure", e);
LOGGER.error("load class bytes from cache file failure", e);
} finally {
IOUtils.closeQuietly(fileInputStream);
}
......@@ -180,7 +180,7 @@ public class CacheableTransformerDecorator implements AgentBuilder.TransformerDe
output = new FileOutputStream(cacheFile);
IOUtils.copy(new ByteArrayInputStream(classfileBuffer), output);
} catch (IOException e) {
logger.error("save class bytes to cache file failure", e);
LOGGER.error("save class bytes to cache file failure", e);
} finally {
IOUtils.closeQuietly(output);
}
......
......@@ -52,7 +52,7 @@ import static net.bytebuddy.matcher.ElementMatchers.not;
* instance methods, or both, {@link ClassEnhancePluginDefine} will add a field of {@link Object} type.
*/
public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePluginDefine {
private static final ILog logger = LogManager.getLogger(ClassEnhancePluginDefine.class);
private static final ILog LOGGER = LogManager.getLogger(ClassEnhancePluginDefine.class);
/**
* New field name.
......
......@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.ILog;
* byte-buddy and sky-walking plugin.
*/
public class ConstructorInter {
private static final ILog logger = LogManager.getLogger(ConstructorInter.class);
private static final ILog LOGGER = LogManager.getLogger(ConstructorInter.class);
/**
* An {@link InstanceConstructorInterceptor} This name should only stay in {@link String}, the real {@link Class}
......@@ -64,7 +64,7 @@ public class ConstructorInter {
interceptor.onConstruct(targetObject, allArguments);
} catch (Throwable t) {
logger.error("ConstructorInter failure.", t);
LOGGER.error("ConstructorInter failure.", t);
}
}
......
......@@ -35,7 +35,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.ILog;
* byte-buddy and sky-walking plugin.
*/
public class InstMethodsInter {
private static final ILog logger = LogManager.getLogger(InstMethodsInter.class);
private static final ILog LOGGER = LogManager.getLogger(InstMethodsInter.class);
/**
* An {@link InstanceMethodsAroundInterceptor} This name should only stay in {@link String}, the real {@link Class}
......@@ -75,7 +75,7 @@ public class InstMethodsInter {
try {
interceptor.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), result);
} catch (Throwable t) {
logger.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
}
Object ret = null;
......@@ -89,14 +89,14 @@ public class InstMethodsInter {
try {
interceptor.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t);
} catch (Throwable t2) {
logger.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
}
throw t;
} finally {
try {
ret = interceptor.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret);
} catch (Throwable t) {
logger.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
}
}
return ret;
......
......@@ -34,7 +34,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* byte-buddy and sky-walking plugin.
*/
public class InstMethodsInterWithOverrideArgs {
private static final ILog logger = LogManager.getLogger(InstMethodsInterWithOverrideArgs.class);
private static final ILog LOGGER = LogManager.getLogger(InstMethodsInterWithOverrideArgs.class);
/**
* An {@link InstanceMethodsAroundInterceptor} This name should only stay in {@link String}, the real {@link Class}
......@@ -74,7 +74,7 @@ public class InstMethodsInterWithOverrideArgs {
try {
interceptor.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), result);
} catch (Throwable t) {
logger.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
}
Object ret = null;
......@@ -88,14 +88,14 @@ public class InstMethodsInterWithOverrideArgs {
try {
interceptor.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t);
} catch (Throwable t2) {
logger.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
}
throw t;
} finally {
try {
ret = interceptor.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret);
} catch (Throwable t) {
logger.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
}
}
return ret;
......
......@@ -33,7 +33,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* byte-buddy and sky-walking plugin.
*/
public class StaticMethodsInter {
private static final ILog logger = LogManager.getLogger(StaticMethodsInter.class);
private static final ILog LOGGER = LogManager.getLogger(StaticMethodsInter.class);
/**
* A class full name, and instanceof {@link StaticMethodsAroundInterceptor} This name should only stay in {@link
......@@ -72,7 +72,7 @@ public class StaticMethodsInter {
try {
interceptor.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), result);
} catch (Throwable t) {
logger.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
}
Object ret = null;
......@@ -86,14 +86,14 @@ public class StaticMethodsInter {
try {
interceptor.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t);
} catch (Throwable t2) {
logger.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
}
throw t;
} finally {
try {
ret = interceptor.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret);
} catch (Throwable t) {
logger.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
}
}
return ret;
......
......@@ -32,7 +32,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* byte-buddy and sky-walking plugin.
*/
public class StaticMethodsInterWithOverrideArgs {
private static final ILog logger = LogManager.getLogger(StaticMethodsInterWithOverrideArgs.class);
private static final ILog LOGGER = LogManager.getLogger(StaticMethodsInterWithOverrideArgs.class);
/**
* A class full name, and instanceof {@link StaticMethodsAroundInterceptor} This name should only stay in {@link
......@@ -71,7 +71,7 @@ public class StaticMethodsInterWithOverrideArgs {
try {
interceptor.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), result);
} catch (Throwable t) {
logger.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
}
Object ret = null;
......@@ -85,14 +85,14 @@ public class StaticMethodsInterWithOverrideArgs {
try {
interceptor.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t);
} catch (Throwable t2) {
logger.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
}
throw t;
} finally {
try {
ret = interceptor.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret);
} catch (Throwable t) {
logger.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
}
}
return ret;
......
......@@ -30,7 +30,7 @@ import org.apache.skywalking.apm.agent.core.plugin.ByteBuddyCoreClasses;
* Since JDK 9, module concept has been introduced. By supporting that, agent core needs to open the
*/
public class JDK9ModuleExporter {
private static final ILog logger = LogManager.getLogger(JDK9ModuleExporter.class);
private static final ILog LOGGER = LogManager.getLogger(JDK9ModuleExporter.class);
private static final String[] HIGH_PRIORITY_CLASSES = {
"org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance",
......
......@@ -52,7 +52,7 @@ public class AgentClassLoader extends ClassLoader {
registerAsParallelCapable();
}
private static final ILog logger = LogManager.getLogger(AgentClassLoader.class);
private static final ILog LOGGER = LogManager.getLogger(AgentClassLoader.class);
/**
* The default class loader for the agent.
*/
......@@ -111,7 +111,7 @@ public class AgentClassLoader extends ClassLoader {
}
return processLoadedClass(defineClass(name, data, 0, data.length));
} catch (IOException e) {
logger.error(e, "find class fail.");
LOGGER.error(e, "find class fail.");
}
}
throw new ClassNotFoundException("Can't find " + name);
......@@ -194,9 +194,9 @@ public class AgentClassLoader extends ClassLoader {
File file = new File(path, fileName);
Jar jar = new Jar(new JarFile(file), file);
jars.add(jar);
logger.info("{} loaded.", file.toString());
LOGGER.info("{} loaded.", file.toString());
} catch (IOException e) {
logger.error(e, "{} jar file can't be resolved", fileName);
LOGGER.error(e, "{} jar file can't be resolved", fileName);
}
}
}
......
......@@ -33,7 +33,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* please pay attention to the WARNING logs.
*/
public class ProtectiveShieldMatcher<T> extends ElementMatcher.Junction.AbstractBase<T> {
private static final ILog logger = LogManager.getLogger(ProtectiveShieldMatcher.class);
private static final ILog LOGGER = LogManager.getLogger(ProtectiveShieldMatcher.class);
private final ElementMatcher<? super T> matcher;
......@@ -45,8 +45,8 @@ public class ProtectiveShieldMatcher<T> extends ElementMatcher.Junction.Abstract
try {
return this.matcher.matches(target);
} catch (Throwable t) {
if (logger.isDebugEnable()) {
logger.debug(t, "Byte-buddy occurs exception when match type.");
if (LOGGER.isDebugEnable()) {
LOGGER.debug(t, "Byte-buddy occurs exception when match type.");
}
return false;
}
......
......@@ -42,7 +42,7 @@ import static org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UP
*/
@DefaultImplementor
public class ProfileSnapshotSender implements BootService, GRPCChannelListener {
private static final ILog logger = LogManager.getLogger(ProfileSnapshotSender.class);
private static final ILog LOGGER = LogManager.getLogger(ProfileSnapshotSender.class);
private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT;
......@@ -86,8 +86,8 @@ public class ProfileSnapshotSender implements BootService, GRPCChannelListener {
public void onError(
Throwable throwable) {
status.finished();
if (logger.isErrorEnable()) {
logger.error(
if (LOGGER.isErrorEnable()) {
LOGGER.error(
throwable,
"Send profile segment snapshot to collector fail with a grpc internal exception."
);
......@@ -109,7 +109,7 @@ public class ProfileSnapshotSender implements BootService, GRPCChannelListener {
snapshotStreamObserver.onCompleted();
status.wait4Finish();
} catch (Throwable t) {
logger.error(t, "Send profile segment snapshot to backend fail.");
LOGGER.error(t, "Send profile segment snapshot to backend fail.");
}
}
}
......
......@@ -55,7 +55,7 @@ import static org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UP
*/
@DefaultImplementor
public class ProfileTaskChannelService implements BootService, Runnable, GRPCChannelListener {
private static final ILog logger = LogManager.getLogger(ProfileTaskChannelService.class);
private static final ILog LOGGER = LogManager.getLogger(ProfileTaskChannelService.class);
// channel status
private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT;
......@@ -93,12 +93,12 @@ public class ProfileTaskChannelService implements BootService, Runnable, GRPCCha
ServiceManager.INSTANCE.findService(CommandService.class).receiveCommand(commands);
} catch (Throwable t) {
if (!(t instanceof StatusRuntimeException)) {
logger.error(t, "Query profile task from backend fail.");
LOGGER.error(t, "Query profile task from backend fail.");
return;
}
final StatusRuntimeException statusRuntimeException = (StatusRuntimeException) t;
if (statusRuntimeException.getStatus().getCode() == Status.Code.UNIMPLEMENTED) {
logger.warn("Backend doesn't support profiling, profiling will be disabled");
LOGGER.warn("Backend doesn't support profiling, profiling will be disabled");
if (getTaskListFuture != null) {
getTaskListFuture.cancel(true);
}
......@@ -128,7 +128,7 @@ public class ProfileTaskChannelService implements BootService, Runnable, GRPCCha
).scheduleWithFixedDelay(
new RunnableWithExceptionProtection(
this,
t -> logger.error("Query profile task list failure.", t)
t -> LOGGER.error("Query profile task list failure.", t)
), 0, Config.Collector.GET_PROFILE_TASK_INTERVAL, TimeUnit.SECONDS
);
......@@ -143,7 +143,7 @@ public class ProfileTaskChannelService implements BootService, Runnable, GRPCCha
sender.send(buffer);
}
},
t -> logger.error("Profile segment snapshot upload failure.", t)
t -> LOGGER.error("Profile segment snapshot upload failure.", t)
), 0, 500, TimeUnit.MILLISECONDS
);
}
......@@ -198,7 +198,7 @@ public class ProfileTaskChannelService implements BootService, Runnable, GRPCCha
profileTaskBlockingStub.withDeadlineAfter(GRPC_UPSTREAM_TIMEOUT, TimeUnit.SECONDS)
.reportTaskFinish(reportBuilder.build());
} catch (Throwable e) {
logger.error(e, "Notify profile task finish to backend fail.");
LOGGER.error(e, "Notify profile task finish to backend fail.");
}
}
......
......@@ -43,7 +43,7 @@ import org.apache.skywalking.apm.util.StringUtil;
@DefaultImplementor
public class ProfileTaskExecutionService implements BootService, TracingThreadListener {
private static final ILog logger = LogManager.getLogger(ProfileTaskExecutionService.class);
private static final ILog LOGGER = LogManager.getLogger(ProfileTaskExecutionService.class);
// add a schedule while waiting for the task to start or finish
private final static ScheduledExecutorService PROFILE_TASK_SCHEDULE = Executors.newSingleThreadScheduledExecutor(
......@@ -74,7 +74,7 @@ public class ProfileTaskExecutionService implements BootService, TracingThreadLi
// check profile task limit
final CheckResult dataError = checkProfileTaskSuccess(task);
if (!dataError.isSuccess()) {
logger.warn(
LOGGER.warn(
"check command error, cannot process this profile task. reason: {}", dataError.getErrorReason());
return;
}
......
......@@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
*/
public class ProfileThread implements Runnable {
private static final ILog logger = LogManager.getLogger(ProfileThread.class);
private static final ILog LOGGER = LogManager.getLogger(ProfileThread.class);
// profiling task context
private final ProfileTaskExecutionContext taskExecutionContext;
......@@ -52,7 +52,7 @@ public class ProfileThread implements Runnable {
// ignore interrupted
// means current task has stopped
} catch (Exception e) {
logger.error(e, "Profiling task fail. taskId:{}", taskExecutionContext.getTask().getTaskId());
LOGGER.error(e, "Profiling task fail. taskId:{}", taskExecutionContext.getTask().getTaskId());
} finally {
// finally stop current profiling task, tell execution service task has stop
profileTaskExecutionService.stopCurrentProfileTask(taskExecutionContext);
......
......@@ -39,7 +39,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
* Add agent version(Described in MANIFEST.MF) to the connection establish stage.
*/
public class AgentIDDecorator implements ChannelDecorator {
private static final ILog logger = LogManager.getLogger(AgentIDDecorator.class);
private static final ILog LOGGER = LogManager.getLogger(AgentIDDecorator.class);
private static final Metadata.Key<String> AGENT_VERSION_HEAD_HEADER_NAME = Metadata.Key.of("Agent-Version", Metadata.ASCII_STRING_MARSHALLER);
private String version = "UNKNOWN";
......@@ -62,7 +62,7 @@ public class AgentIDDecorator implements ChannelDecorator {
}
}
} catch (Exception e) {
logger.warn("Can't read version from MANIFEST.MF in the agent jar");
LOGGER.warn("Can't read version from MANIFEST.MF in the agent jar");
}
}
......
......@@ -39,7 +39,7 @@ import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
@DefaultImplementor
public class GRPCChannelManager implements BootService, Runnable {
private static final ILog logger = LogManager.getLogger(GRPCChannelManager.class);
private static final ILog LOGGER = LogManager.getLogger(GRPCChannelManager.class);
private volatile GRPCChannel managedChannel = null;
private volatile ScheduledFuture<?> connectCheckFuture;
......@@ -58,8 +58,8 @@ public class GRPCChannelManager implements BootService, Runnable {
@Override
public void boot() {
if (Config.Collector.BACKEND_SERVICE.trim().length() == 0) {
logger.error("Collector server addresses are not set.");
logger.error("Agent will not uplink any data.");
LOGGER.error("Collector server addresses are not set.");
LOGGER.error("Agent will not uplink any data.");
return;
}
grpcServers = Arrays.asList(Config.Collector.BACKEND_SERVICE.split(","));
......@@ -68,7 +68,7 @@ public class GRPCChannelManager implements BootService, Runnable {
).scheduleAtFixedRate(
new RunnableWithExceptionProtection(
this,
t -> logger.error("unexpected exception.", t)
t -> LOGGER.error("unexpected exception.", t)
), 0, Config.Collector.GRPC_CHANNEL_CHECK_INTERVAL, TimeUnit.SECONDS
);
}
......@@ -86,12 +86,12 @@ public class GRPCChannelManager implements BootService, Runnable {
if (managedChannel != null) {
managedChannel.shutdownNow();
}
logger.debug("Selected collector grpc service shutdown.");
LOGGER.debug("Selected collector grpc service shutdown.");
}
@Override
public void run() {
logger.debug("Selected collector grpc service running, reconnect:{}.", reconnect);
LOGGER.debug("Selected collector grpc service running, reconnect:{}.", reconnect);
if (reconnect) {
if (grpcServers.size() > 0) {
String server = "";
......@@ -127,11 +127,11 @@ public class GRPCChannelManager implements BootService, Runnable {
return;
} catch (Throwable t) {
logger.error(t, "Create channel to {} fail.", server);
LOGGER.error(t, "Create channel to {} fail.", server);
}
}
logger.debug(
LOGGER.debug(
"Selected collector grpc service is not available. Wait {} seconds to retry",
Config.Collector.GRPC_CHANNEL_CHECK_INTERVAL
);
......@@ -161,7 +161,7 @@ public class GRPCChannelManager implements BootService, Runnable {
try {
listener.statusChanged(status);
} catch (Throwable t) {
logger.error(t, "Fail to notify {} about channel connected.", listener.getClass().getName());
LOGGER.error(t, "Fail to notify {} about channel connected.", listener.getClass().getName());
}
}
}
......
......@@ -22,7 +22,7 @@ import org.apache.skywalking.apm.agent.core.logging.api.ILog;
import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
public class GRPCStreamServiceStatus {
private static final ILog logger = LogManager.getLogger(GRPCStreamServiceStatus.class);
private static final ILog LOGGER = LogManager.getLogger(GRPCStreamServiceStatus.class);
private volatile boolean status;
public GRPCStreamServiceStatus(boolean status) {
......@@ -49,7 +49,7 @@ public class GRPCStreamServiceStatus {
hasWaited += recheckCycle;
if (recheckCycle >= maxCycle) {
logger.warn("Collector traceSegment service doesn't response in {} seconds.", hasWaited / 1000);
LOGGER.warn("Collector traceSegment service doesn't response in {} seconds.", hasWaited / 1000);
} else {
recheckCycle = Math.min(recheckCycle * 2, maxCycle);
}
......
......@@ -46,7 +46,7 @@ import static org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UP
@DefaultImplementor
public class ServiceManagementClient implements BootService, Runnable, GRPCChannelListener {
private static final ILog logger = LogManager.getLogger(ServiceManagementClient.class);
private static final ILog LOGGER = LogManager.getLogger(ServiceManagementClient.class);
private static List<KeyStringValuePair> SERVICE_INSTANCE_PROPERTIES;
private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT;
......@@ -90,7 +90,7 @@ public class ServiceManagementClient implements BootService, Runnable, GRPCChann
).scheduleAtFixedRate(
new RunnableWithExceptionProtection(
this,
t -> logger.error("unexpected exception.", t)
t -> LOGGER.error("unexpected exception.", t)
), 0, Config.Collector.HEARTBEAT_PERIOD,
TimeUnit.SECONDS
);
......@@ -107,7 +107,7 @@ public class ServiceManagementClient implements BootService, Runnable, GRPCChann
@Override
public void run() {
logger.debug("ServiceManagementClient running, status:{}.", status);
LOGGER.debug("ServiceManagementClient running, status:{}.", status);
if (GRPCChannelStatus.CONNECTED.equals(status)) {
try {
......@@ -136,7 +136,7 @@ public class ServiceManagementClient implements BootService, Runnable, GRPCChann
}
}
} catch (Throwable t) {
logger.error(t, "ServiceManagementClient execute fail.");
LOGGER.error(t, "ServiceManagementClient execute fail.");
ServiceManager.INSTANCE.findService(GRPCChannelManager.class).reportError(t);
}
}
......
......@@ -45,7 +45,7 @@ import static org.apache.skywalking.apm.agent.core.remote.GRPCChannelStatus.CONN
@DefaultImplementor
public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSegment>, TracingContextListener, GRPCChannelListener {
private static final ILog logger = LogManager.getLogger(TraceSegmentServiceClient.class);
private static final ILog LOGGER = LogManager.getLogger(TraceSegmentServiceClient.class);
private long lastLogTime;
private long segmentUplinkedCounter;
......@@ -102,8 +102,8 @@ public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSe
public void onError(
Throwable throwable) {
status.finished();
if (logger.isErrorEnable()) {
logger.error(
if (LOGGER.isErrorEnable()) {
LOGGER.error(
throwable,
"Send UpstreamSegment to collector fail with a grpc internal exception."
);
......@@ -125,7 +125,7 @@ public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSe
upstreamSegmentStreamObserver.onNext(upstreamSegment);
}
} catch (Throwable t) {
logger.error(t, "Transform and send UpstreamSegment to collector fail.");
LOGGER.error(t, "Transform and send UpstreamSegment to collector fail.");
}
upstreamSegmentStreamObserver.onCompleted();
......@@ -144,11 +144,11 @@ public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSe
if (currentTimeMillis - lastLogTime > 30 * 1000) {
lastLogTime = currentTimeMillis;
if (segmentUplinkedCounter > 0) {
logger.debug("{} trace segments have been sent to collector.", segmentUplinkedCounter);
LOGGER.debug("{} trace segments have been sent to collector.", segmentUplinkedCounter);
segmentUplinkedCounter = 0;
}
if (segmentAbandonedCounter > 0) {
logger.debug(
LOGGER.debug(
"{} trace segments have been abandoned, cause by no available channel.", segmentAbandonedCounter);
segmentAbandonedCounter = 0;
}
......@@ -157,7 +157,7 @@ public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSe
@Override
public void onError(List<TraceSegment> data, Throwable t) {
logger.error(t, "Try to send {} trace segments to collector, with unexpected exception.", data.size());
LOGGER.error(t, "Try to send {} trace segments to collector, with unexpected exception.", data.size());
}
@Override
......@@ -171,8 +171,8 @@ public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSe
return;
}
if (!carrier.produce(traceSegment)) {
if (logger.isDebugEnable()) {
logger.debug("One trace segment has been abandoned, cause by buffer is full.");
if (LOGGER.isDebugEnable()) {
LOGGER.debug("One trace segment has been abandoned, cause by buffer is full.");
}
}
}
......
......@@ -41,7 +41,7 @@ import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
*/
@DefaultImplementor
public class SamplingService implements BootService {
private static final ILog logger = LogManager.getLogger(SamplingService.class);
private static final ILog LOGGER = LogManager.getLogger(SamplingService.class);
private volatile boolean on = false;
private volatile AtomicInteger samplingFactorHolder;
......@@ -67,8 +67,8 @@ public class SamplingService implements BootService {
ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(
new DefaultNamedThreadFactory("SamplingService"));
scheduledFuture = service.scheduleAtFixedRate(new RunnableWithExceptionProtection(
this::resetSamplingFactor, t -> logger.error("unexpected exception.", t)), 0, 3, TimeUnit.SECONDS);
logger.debug(
this::resetSamplingFactor, t -> LOGGER.error("unexpected exception.", t)), 0, 3, TimeUnit.SECONDS);
LOGGER.debug(
"Agent sampling mechanism started. Sample {} traces in 3 seconds.", Config.Agent.SAMPLE_N_PER_3_SECS);
}
}
......
......@@ -34,7 +34,7 @@ import java.util.Map;
public class CustomizeExpression {
private static final ILog logger = LogManager.getLogger(CustomizeExpression.class);
private static final ILog LOGGER = LogManager.getLogger(CustomizeExpression.class);
public static Map<String, Object> evaluationContext(Object[] allArguments) {
Map<String, Object> context = new HashMap<>();
......@@ -70,7 +70,7 @@ public class CustomizeExpression {
try {
context.put(field.getName(), field.get(ret));
} catch (Exception e) {
logger.debug("evaluationReturnContext error, ret is {}, exception is {}", ret, e.getMessage());
LOGGER.debug("evaluationReturnContext error, ret is {}, exception is {}", ret, e.getMessage());
}
}
}
......@@ -83,7 +83,7 @@ public class CustomizeExpression {
Object o = context.get(es[0]);
return o == null ? "null" : String.valueOf(parse(es, o, 0));
} catch (Exception e) {
logger.debug("parse expression error, expression is {}, exception is {}", expression, e.getMessage());
LOGGER.debug("parse expression error, expression is {}, exception is {}", expression, e.getMessage());
}
return "null";
}
......@@ -97,7 +97,7 @@ public class CustomizeExpression {
Object o = context.get(es[1]);
return o == null ? "null" : String.valueOf(parse(es, o, 1));
} catch (Exception e) {
logger.debug("parse expression error, expression is {}, exception is {}", expression, e.getMessage());
LOGGER.debug("parse expression error, expression is {}, exception is {}", expression, e.getMessage());
}
return "null";
}
......@@ -152,7 +152,7 @@ public class CustomizeExpression {
return f.get(o);
}
} catch (Exception e) {
logger.debug("matcher default error, expression is {}, object is {}, expression is {}", expression, o, e.getMessage());
LOGGER.debug("matcher default error, expression is {}, object is {}, expression is {}", expression, o, e.getMessage());
}
return null;
}
......
......@@ -53,7 +53,7 @@ import static net.bytebuddy.matcher.ElementMatchers.not;
* The main entrance of sky-walking agent, based on javaagent mechanism.
*/
public class SkyWalkingAgent {
private static final ILog logger = LogManager.getLogger(SkyWalkingAgent.class);
private static final ILog LOGGER = LogManager.getLogger(SkyWalkingAgent.class);
/**
* Main entrance. Use byte-buddy transform to enhance all classes, which define in plugins.
......@@ -65,10 +65,10 @@ public class SkyWalkingAgent {
pluginFinder = new PluginFinder(new PluginBootstrap().loadPlugins());
} catch (AgentPackageNotFoundException ape) {
logger.error(ape, "Locate agent.jar failure. Shutting down.");
LOGGER.error(ape, "Locate agent.jar failure. Shutting down.");
return;
} catch (Exception e) {
logger.error(e, "SkyWalking agent initialized failure. Shutting down.");
LOGGER.error(e, "SkyWalking agent initialized failure. Shutting down.");
return;
}
......@@ -88,23 +88,23 @@ public class SkyWalkingAgent {
try {
agentBuilder = BootstrapInstrumentBoost.inject(pluginFinder, instrumentation, agentBuilder, edgeClasses);
} catch (Exception e) {
logger.error(e, "SkyWalking agent inject bootstrap instrumentation failure. Shutting down.");
LOGGER.error(e, "SkyWalking agent inject bootstrap instrumentation failure. Shutting down.");
return;
}
try {
agentBuilder = JDK9ModuleExporter.openReadEdge(instrumentation, agentBuilder, edgeClasses);
} catch (Exception e) {
logger.error(e, "SkyWalking agent open read edge in JDK 9+ failure. Shutting down.");
LOGGER.error(e, "SkyWalking agent open read edge in JDK 9+ failure. Shutting down.");
return;
}
if (Config.Agent.IS_CACHE_ENHANCED_CLASS) {
try {
agentBuilder = agentBuilder.with(new CacheableTransformerDecorator(Config.Agent.CLASS_CACHE_MODE));
logger.info("SkyWalking agent class cache [{}] activated.", Config.Agent.CLASS_CACHE_MODE);
LOGGER.info("SkyWalking agent class cache [{}] activated.", Config.Agent.CLASS_CACHE_MODE);
} catch (Exception e) {
logger.error(e, "SkyWalking agent can't active class cache.");
LOGGER.error(e, "SkyWalking agent can't active class cache.");
}
}
......@@ -117,7 +117,7 @@ public class SkyWalkingAgent {
try {
ServiceManager.INSTANCE.boot();
} catch (Exception e) {
logger.error(e, "Skywalking agent boot failure.");
LOGGER.error(e, "Skywalking agent boot failure.");
}
Runtime.getRuntime()
......@@ -148,13 +148,13 @@ public class SkyWalkingAgent {
}
}
if (context.isEnhanced()) {
logger.debug("Finish the prepare stage for {}.", typeDescription.getName());
LOGGER.debug("Finish the prepare stage for {}.", typeDescription.getName());
}
return newBuilder;
}
logger.debug("Matched class {}, but ignore by finding mechanism.", typeDescription.getTypeName());
LOGGER.debug("Matched class {}, but ignore by finding mechanism.", typeDescription.getTypeName());
return builder;
}
}
......@@ -175,8 +175,8 @@ public class SkyWalkingAgent {
final JavaModule module,
final boolean loaded,
final DynamicType dynamicType) {
if (logger.isDebugEnable()) {
logger.debug("On Transformation class {}.", typeDescription.getName());
if (LOGGER.isDebugEnable()) {
LOGGER.debug("On Transformation class {}.", typeDescription.getName());
}
InstrumentDebuggingClass.INSTANCE.log(dynamicType);
......@@ -196,7 +196,7 @@ public class SkyWalkingAgent {
final JavaModule module,
final boolean loaded,
final Throwable throwable) {
logger.error("Enhance class " + typeName + " error.", throwable);
LOGGER.error("Enhance class " + typeName + " error.", throwable);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceC
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
public abstract class AbstractRequestInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
private static final ILog logger = LogManager.getLogger(GenericRequestorInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(GenericRequestorInterceptor.class);
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
......@@ -46,7 +46,7 @@ public abstract class AbstractRequestInterceptor implements InstanceConstructorI
.getRemoteName()));
} catch (IOException e) {
objInst.setSkyWalkingDynamicField(new AvroInstance("Undefined", "Undefined"));
logger.error("Failed to get Avro Remote Client Information.", e);
LOGGER.error("Failed to get Avro Remote Client Information.", e);
}
}
}
......
......@@ -37,7 +37,7 @@ import static org.apache.skywalking.apm.plugin.elasticsearch.v5.ElasticsearchPlu
public class TransportProxyClientInterceptor implements InstanceConstructorInterceptor {
private static final ILog logger = LogManager.getLogger(TransportProxyClientInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(TransportProxyClientInterceptor.class);
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
......@@ -121,7 +121,7 @@ public class TransportProxyClientInterceptor implements InstanceConstructorInter
try {
updateDsl = updateRequest.toXContent(XContentFactory.jsonBuilder(), null).string();
} catch (IOException e) {
logger.warn("trace update request dsl error: ", e);
LOGGER.warn("trace update request dsl error: ", e);
}
enhanceInfo.setSource(updateDsl);
}
......
......@@ -30,7 +30,7 @@ import org.elasticsearch.client.RestClientBuilder;
public class RestHighLevelClientConInterceptor implements InstanceConstructorInterceptor {
private static final ILog logger = LogManager.getLogger(RestHighLevelClientConInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(RestHighLevelClientConInterceptor.class);
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
......
......@@ -44,7 +44,7 @@ import java.lang.reflect.Method;
})
public class MongoDBInterceptor implements InstanceMethodsAroundInterceptor, InstanceConstructorInterceptor {
private static final ILog logger = LogManager.getLogger(MongoDBInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(MongoDBInterceptor.class);
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
......@@ -58,8 +58,8 @@ public class MongoDBInterceptor implements InstanceMethodsAroundInterceptor, Ins
MethodInterceptResult result) {
String executeMethod = allArguments[0].getClass().getSimpleName();
String remotePeer = (String) objInst.getSkyWalkingDynamicField();
if (logger.isDebugEnable()) {
logger.debug("Mongo execute: [executeMethod: {}, remotePeer: {}]", executeMethod, remotePeer);
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Mongo execute: [executeMethod: {}, remotePeer: {}]", executeMethod, remotePeer);
}
MongoSpanHelper.createExitSpan(executeMethod, remotePeer, allArguments[0]);
}
......
......@@ -32,7 +32,7 @@ import java.lang.reflect.Method;
@SuppressWarnings("Duplicates")
public class MongoDBClientDelegateInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
private static final ILog logger = LogManager.getLogger(MongoDBClientDelegateInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(MongoDBClientDelegateInterceptor.class);
@SuppressWarnings("deprecation")
@Override
......@@ -56,8 +56,8 @@ public class MongoDBClientDelegateInterceptor implements InstanceConstructorInte
// @see: org.apache.skywalking.apm.plugin.mongodb.v3.define.v37.MongoDBOperationExecutorInstrumentation
EnhancedInstance retInstance = (EnhancedInstance) ret;
String remotePeer = (String) objInst.getSkyWalkingDynamicField();
if (logger.isDebugEnable()) {
logger.debug("Mark OperationExecutor remotePeer: {}", remotePeer);
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Mark OperationExecutor remotePeer: {}", remotePeer);
}
retInstance.setSkyWalkingDynamicField(remotePeer);
}
......
......@@ -32,7 +32,7 @@ import java.lang.reflect.Method;
@SuppressWarnings("Duplicates")
public class MongoDBOperationExecutorInterceptor implements InstanceMethodsAroundInterceptor {
private static final ILog logger = LogManager.getLogger(MongoDBOperationExecutorInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(MongoDBOperationExecutorInterceptor.class);
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
......@@ -41,8 +41,8 @@ public class MongoDBOperationExecutorInterceptor implements InstanceMethodsAroun
// OperationExecutor has be mark it's remotePeer
// @see: MongoDBClientDelegateInterceptor.afterMethod
String remotePeer = (String) objInst.getSkyWalkingDynamicField();
if (logger.isDebugEnable()) {
logger.debug("Mongo execute: [executeMethod: {}, remotePeer: {}]", executeMethod, remotePeer);
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Mongo execute: [executeMethod: {}, remotePeer: {}]", executeMethod, remotePeer);
}
MongoSpanHelper.createExitSpan(executeMethod, remotePeer, allArguments[0]);
}
......
......@@ -34,7 +34,7 @@ import java.util.Collection;
public class ConnectionManagerInterceptor implements InstanceMethodsAroundInterceptor {
private static final ILog logger = LogManager.getLogger(ConnectionManagerInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(ConnectionManagerInterceptor.class);
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
......@@ -86,7 +86,7 @@ public class ConnectionManagerInterceptor implements InstanceMethodsAroundInterc
return ret;
}
} catch (Exception e) {
logger.warn("redisClient set peer error: ", e);
LOGGER.warn("redisClient set peer error: ", e);
}
return ret;
}
......@@ -113,7 +113,7 @@ public class ConnectionManagerInterceptor implements InstanceMethodsAroundInterc
URI uri = (URI) obj;
return uri.getHost() + ":" + uri.getPort();
} else {
logger.warn("redisson not support this version");
LOGGER.warn("redisson not support this version");
return null;
}
}
......
......@@ -42,7 +42,7 @@ import java.net.InetSocketAddress;
public class RedisConnectionMethodInterceptor implements InstanceMethodsAroundInterceptor, InstanceConstructorInterceptor {
private static final ILog logger = LogManager.getLogger(RedisConnectionMethodInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(RedisConnectionMethodInterceptor.class);
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
......@@ -118,7 +118,7 @@ public class RedisConnectionMethodInterceptor implements InstanceMethodsAroundIn
String port = String.valueOf(ClassUtil.getObjectField(address, "port"));
peer = host + ":" + port;
} catch (Exception e) {
logger.warn("RedisConnection create peer error: ", e);
LOGGER.warn("RedisConnection create peer error: ", e);
}
}
objInst.setSkyWalkingDynamicField(peer);
......
......@@ -27,7 +27,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt
public class TraceContextInterceptor implements StaticMethodsAroundInterceptor {
private ILog logger = LogManager.getLogger(TraceContextInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(TraceContextInterceptor.class);
@Override
public void beforeMethod(Class clazz, Method method, Object[] allArguments, Class<?>[] parameterTypes,
......@@ -44,6 +44,6 @@ public class TraceContextInterceptor implements StaticMethodsAroundInterceptor {
@Override
public void handleMethodException(Class clazz, Method method, Object[] allArguments, Class<?>[] parameterTypes,
Throwable t) {
logger.error("Failed to getDefault trace Id.", t);
LOGGER.error("Failed to getDefault trace Id.", t);
}
}
......@@ -57,7 +57,7 @@ public enum CustomizeConfiguration {
INSTANCE;
private static final ILog logger = LogManager.getLogger(CustomizeConfiguration.class);
private static final ILog LOGGER = LogManager.getLogger(CustomizeConfiguration.class);
/**
* Some information after custom enhancements, this configuration is used by the custom enhancement plugin.
......@@ -76,7 +76,7 @@ public enum CustomizeConfiguration {
addContextEnhanceClass(configuration);
}
} catch (Exception e) {
logger.error("CustomizeConfiguration loadForAgent fail", e);
LOGGER.error("CustomizeConfiguration loadForAgent fail", e);
}
}
......@@ -92,7 +92,7 @@ public enum CustomizeConfiguration {
addContextMethodConfiguration(configuration);
}
} catch (Exception e) {
logger.error("CustomizeConfiguration loadForConfiguration fail", e);
LOGGER.error("CustomizeConfiguration loadForConfiguration fail", e);
} finally {
LOAD_FOR_CONFIGURATION.set(true);
}
......@@ -257,7 +257,7 @@ public enum CustomizeConfiguration {
}
return configuration;
} catch (Exception e) {
logger.error(e, "Failed to resolver, className is {}, methodDesc is {}.", className, methodDesc);
LOGGER.error(e, "Failed to resolver, className is {}, methodDesc is {}.", className, methodDesc);
}
return null;
}
......
......@@ -38,7 +38,7 @@ import java.util.Set;
public class CustomizeInstrumentationLoader implements InstrumentationLoader {
private static final ILog logger = LogManager.getLogger(CustomizeInstrumentationLoader.class);
private static final ILog LOGGER = LogManager.getLogger(CustomizeInstrumentationLoader.class);
@Override
public List<AbstractClassEnhancePluginDefine> load(AgentClassLoader classLoader) {
......@@ -55,7 +55,7 @@ public class CustomizeInstrumentationLoader implements InstrumentationLoader {
instrumentations.add(plugin);
}
} catch (Exception e) {
logger.error(e, "InstrumentationLoader loader is error, spi loader is {}", CustomizeInstrumentationLoader.class
LOGGER.error(e, "InstrumentationLoader loader is error, spi loader is {}", CustomizeInstrumentationLoader.class
.getName());
}
return instrumentations;
......
......@@ -42,7 +42,7 @@ import java.util.List;
public class ClientCnxnInterceptor implements InstanceMethodsAroundInterceptor, InstanceConstructorInterceptor {
private static final ILog logger = LogManager.getLogger(ClientCnxnInterceptor.class);
private static final ILog LOGGER = LogManager.getLogger(ClientCnxnInterceptor.class);
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
......@@ -90,9 +90,9 @@ public class ClientCnxnInterceptor implements InstanceMethodsAroundInterceptor,
}
objInst.setSkyWalkingDynamicField(peer.toString());
} catch (NoSuchFieldException e) {
logger.warn("NoSuchFieldException, not be compatible with this version of zookeeper", e);
LOGGER.warn("NoSuchFieldException, not be compatible with this version of zookeeper", e);
} catch (IllegalAccessException e) {
logger.warn("IllegalAccessException, not be compatible with this version of zookeeper", e);
LOGGER.warn("IllegalAccessException, not be compatible with this version of zookeeper", e);
}
}
}
......@@ -39,7 +39,7 @@ import org.apache.skywalking.apm.network.language.agent.v3.JVMMetricCollection;
*/
@OverrideImplementor(JVMMetricsSender.class)
public class KafkaJVMMetricsSender extends JVMMetricsSender {
private static final ILog logger = LogManager.getLogger(KafkaJVMMetricsSender.class);
private static final ILog LOGGER = LogManager.getLogger(KafkaJVMMetricsSender.class);
private KafkaProducer<String, Bytes> producer;
private String topic;
......@@ -59,8 +59,8 @@ public class KafkaJVMMetricsSender extends JVMMetricsSender {
.setServiceInstance(Config.Agent.INSTANCE_NAME)
.build();
if (logger.isDebugEnable()) {
logger.debug(
if (LOGGER.isDebugEnable()) {
LOGGER.debug(
"JVM metrics reporting, topic: {}, key: {}, length: {}", topic, metrics.getServiceInstance(),
buffer.size()
);
......
......@@ -38,7 +38,7 @@ import org.apache.skywalking.apm.network.language.agent.v3.MeterDataCollection;
*/
@OverrideImplementor(MeterSender.class)
public class KafkaMeterSender extends MeterSender {
private static final ILog logger = LogManager.getLogger(KafkaTraceSegmentServiceClient.class);
private static final ILog LOGGER = LogManager.getLogger(KafkaTraceSegmentServiceClient.class);
private String topic;
private KafkaProducer<String, Bytes> producer;
......@@ -56,8 +56,8 @@ public class KafkaMeterSender extends MeterSender {
public void send(Map<MeterId, MeterTransformer> meterMap, MeterService meterService) {
MeterDataCollection.Builder builder = MeterDataCollection.newBuilder();
transform(meterMap, meterData -> {
if (logger.isDebugEnable()) {
logger.debug("Meter data reporting, instance: {}", meterData.getServiceInstance());
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Meter data reporting, instance: {}", meterData.getServiceInstance());
}
builder.addMeterData(meterData);
});
......
......@@ -36,7 +36,7 @@ import org.apache.skywalking.apm.network.language.profile.v3.ThreadSnapshot;
*/
@OverrideImplementor(ProfileSnapshotSender.class)
public class KafkaProfileSnapshotSender extends ProfileSnapshotSender {
private static final ILog logger = LogManager.getLogger(ProfileSnapshotSender.class);
private static final ILog LOGGER = LogManager.getLogger(ProfileSnapshotSender.class);
private String topic;
private KafkaProducer<String, Bytes> producer;
......@@ -55,8 +55,8 @@ public class KafkaProfileSnapshotSender extends ProfileSnapshotSender {
public void send(final List<TracingThreadSnapshot> buffer) {
for (TracingThreadSnapshot snapshot : buffer) {
final ThreadSnapshot object = snapshot.transform();
if (logger.isDebugEnable()) {
logger.debug("Thread snapshot reporting, topic: {}, taskId: {}, sequence:{}, traceId: {}",
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Thread snapshot reporting, topic: {}, taskId: {}, sequence:{}, traceId: {}",
object.getTaskId(), object.getSequence(), object.getTraceSegmentId()
);
}
......
......@@ -47,7 +47,7 @@ import org.apache.skywalking.apm.util.StringUtil;
*/
@OverrideImplementor(ServiceManagementClient.class)
public class KafkaServiceManagementServiceClient implements BootService, Runnable {
private static final ILog logger = LogManager.getLogger(KafkaServiceManagementServiceClient.class);
private static final ILog LOGGER = LogManager.getLogger(KafkaServiceManagementServiceClient.class);
private static List<KeyStringValuePair> SERVICE_INSTANCE_PROPERTIES;
......@@ -83,7 +83,7 @@ public class KafkaServiceManagementServiceClient implements BootService, Runnabl
new DefaultNamedThreadFactory("ServiceManagementClientKafkaProducer")
).scheduleAtFixedRate(new RunnableWithExceptionProtection(
this,
t -> logger.error("unexpected exception.", t)
t -> LOGGER.error("unexpected exception.", t)
), 0, Config.Collector.HEARTBEAT_PERIOD, TimeUnit.SECONDS);
InstanceProperties instance = InstanceProperties.newBuilder()
......@@ -103,8 +103,8 @@ public class KafkaServiceManagementServiceClient implements BootService, Runnabl
.setService(Config.Agent.SERVICE_NAME)
.setServiceInstance(Config.Agent.INSTANCE_NAME)
.build();
if (logger.isDebugEnable()) {
logger.debug("Heartbeat reporting, instance: {}", ping.getServiceInstance());
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Heartbeat reporting, instance: {}", ping.getServiceInstance());
}
producer.send(new ProducerRecord<>(topic, ping.getServiceInstance(), Bytes.wrap(ping.toByteArray())));
}
......
......@@ -37,7 +37,7 @@ import org.apache.skywalking.apm.network.language.agent.v3.SegmentObject;
*/
@OverrideImplementor(TraceSegmentServiceClient.class)
public class KafkaTraceSegmentServiceClient implements BootService, TracingContextListener {
private static final ILog logger = LogManager.getLogger(KafkaTraceSegmentServiceClient.class);
private static final ILog LOGGER = LogManager.getLogger(KafkaTraceSegmentServiceClient.class);
private String topic;
private KafkaProducer<String, Bytes> producer;
......@@ -64,12 +64,12 @@ public class KafkaTraceSegmentServiceClient implements BootService, TracingConte
@Override
public void afterFinished(final TraceSegment traceSegment) {
if (logger.isDebugEnable()) {
logger.debug("Trace segment reporting, traceId: {}", traceSegment.getTraceSegmentId());
if (LOGGER.isDebugEnable()) {
LOGGER.debug("Trace segment reporting, traceId: {}", traceSegment.getTraceSegmentId());
}
if (traceSegment.isIgnore()) {
logger.debug("Trace[TraceId={}] is ignored.", traceSegment.getTraceSegmentId());
LOGGER.debug("Trace[TraceId={}] is ignored.", traceSegment.getTraceSegmentId());
return;
}
SegmentObject upstreamSegment = traceSegment.transform();
......
......@@ -42,7 +42,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JVMSourceDispatcher {
private static final Logger logger = LoggerFactory.getLogger(JVMSourceDispatcher.class);
private static final Logger LOGGER = LoggerFactory.getLogger(JVMSourceDispatcher.class);
private final SourceReceiver sourceReceiver;
public JVMSourceDispatcher(ModuleManager moduleManager) {
......
......@@ -50,7 +50,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GRPCExporter extends MetricFormatter implements MetricValuesExportService, IConsumer<ExportData> {
private static final Logger logger = LoggerFactory.getLogger(GRPCExporter.class);
private static final Logger LOGGER = LoggerFactory.getLogger(GRPCExporter.class);
private GRPCExporterSetting setting;
private final MetricExportServiceGrpc.MetricExportServiceStub exportServiceFutureStub;
......@@ -87,7 +87,7 @@ public class GRPCExporter extends MetricFormatter implements MetricValuesExportS
SubscriptionsResp subscription = blockingStub.withDeadlineAfter(10, TimeUnit.SECONDS)
.subscription(SubscriptionReq.newBuilder().build());
subscription.getMetricNamesList().forEach(subscriptionSet::add);
logger.debug("Get exporter subscription list, {}", subscriptionSet);
LOGGER.debug("Get exporter subscription list, {}", subscriptionSet);
}
@Override
......@@ -179,7 +179,7 @@ public class GRPCExporter extends MetricFormatter implements MetricValuesExportS
}
if (sleepTime > 2000L) {
logger.warn(
LOGGER.warn(
"Export {} metrics to {}:{}, wait {} milliseconds.", exportNum.get(), setting.getTargetHost(),
setting
.getTargetPort(), sleepTime
......@@ -188,14 +188,14 @@ public class GRPCExporter extends MetricFormatter implements MetricValuesExportS
}
}
logger.debug(
LOGGER.debug(
"Exported {} metrics to {}:{} in {} milliseconds.", exportNum.get(), setting.getTargetHost(), setting
.getTargetPort(), sleepTime);
}
@Override
public void onError(List<ExportData> data, Throwable t) {
logger.error(t.getMessage(), t);
LOGGER.error(t.getMessage(), t);
}
@Override
......
......@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
* trigger and the alarm rules to decides whether send the alarm to database and webhook(s)
*/
public class AlarmCore {
private static final Logger logger = LoggerFactory.getLogger(AlarmCore.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AlarmCore.class);
private LocalDateTime lastExecuteTime;
private AlarmRulesWatcher alarmRulesWatcher;
......@@ -77,7 +77,7 @@ public class AlarmCore {
allCallbacks.forEach(callback -> callback.doAlarm(alarmMessageList));
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
}
}, 10, 10, TimeUnit.SECONDS);
}
......
......@@ -22,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Threshold {
private static final Logger logger = LoggerFactory.getLogger(Threshold.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Threshold.class);
private static final String NONE_THRESHOLD = "-";
private String alarmRuleName;
......@@ -78,7 +78,7 @@ public class Threshold {
}
}
} catch (NumberFormatException e) {
logger.warn("Alarm rule {} threshold doesn't match the metrics type, expected type: {}", alarmRuleName, type);
LOGGER.warn("Alarm rule {} threshold doesn't match the metrics type, expected type: {}", alarmRuleName, type);
}
}
}
......@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
* Use SkyWalking alarm webhook API call a remote endpoints.
*/
public class WebhookCallback implements AlarmCallback {
private static final Logger logger = LoggerFactory.getLogger(WebhookCallback.class);
private static final Logger LOGGER = LoggerFactory.getLogger(WebhookCallback.class);
private static final int HTTP_CONNECT_TIMEOUT = 1000;
private static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 1000;
private static final int HTTP_SOCKET_TIMEOUT = 10000;
......@@ -81,19 +81,19 @@ public class WebhookCallback implements AlarmCallback {
CloseableHttpResponse httpResponse = httpClient.execute(post);
StatusLine statusLine = httpResponse.getStatusLine();
if (statusLine != null && statusLine.getStatusCode() != HttpStatus.SC_OK) {
logger.error("send alarm to " + url + " failure. Response code: " + statusLine.getStatusCode());
LOGGER.error("send alarm to " + url + " failure. Response code: " + statusLine.getStatusCode());
}
} catch (UnsupportedEncodingException e) {
logger.error("Alarm to JSON error, " + e.getMessage(), e);
LOGGER.error("Alarm to JSON error, " + e.getMessage(), e);
} catch (IOException e) {
logger.error("send alarm to " + url + " failure.", e);
LOGGER.error("send alarm to " + url + " failure.", e);
}
});
} finally {
try {
httpClient.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
}
}
}
......
......@@ -37,7 +37,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class EtcdCoordinator implements ClusterRegister, ClusterNodesQuery {
private static final Logger logger = LoggerFactory.getLogger(EtcdCoordinator.class);
private static final Logger LOGGER = LoggerFactory.getLogger(EtcdCoordinator.class);
private ClusterModuleEtcdConfig config;
......@@ -119,7 +119,7 @@ public class EtcdCoordinator implements ClusterRegister, ClusterNodesQuery {
try {
client.put(key, json).ttl(KEY_TTL).send().get();
} catch (Exception ee) {
logger.error(ee.getMessage(), ee);
LOGGER.error(ee.getMessage(), ee);
}
}
}, 5 * 1000, 30 * 1000, TimeUnit.MILLISECONDS);
......
......@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
public class ClusterModuleStandaloneProvider extends ModuleProvider {
private static final Logger logger = LoggerFactory.getLogger(ClusterModuleStandaloneProvider.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ClusterModuleStandaloneProvider.class);
public ClusterModuleStandaloneProvider() {
super();
......
......@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
*/
public class ClusterModuleZookeeperProvider extends ModuleProvider {
private static final Logger logger = LoggerFactory.getLogger(ClusterModuleZookeeperProvider.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ClusterModuleZookeeperProvider.class);
private static final String BASE_PATH = "/skywalking";
......@@ -132,7 +132,7 @@ public class ClusterModuleZookeeperProvider extends ModuleProvider {
serviceDiscovery.start();
coordinator = new ZookeeperCoordinator(config, serviceDiscovery);
} catch (Exception e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
throw new ModuleStartException(e.getMessage(), e);
}
......
......@@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ZookeeperCoordinator implements ClusterRegister, ClusterNodesQuery {
private static final Logger logger = LoggerFactory.getLogger(ZookeeperCoordinator.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ZookeeperCoordinator.class);
private static final String REMOTE_NAME_PATH = "remote";
......
......@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
* The default implementor of Config Watcher register.
*/
public abstract class ConfigWatcherRegister implements DynamicConfigurationService {
private static final Logger logger = LoggerFactory.getLogger(ConfigWatcherRegister.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigWatcherRegister.class);
public static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n");
private Register register = new Register();
......@@ -65,13 +65,13 @@ public abstract class ConfigWatcherRegister implements DynamicConfigurationServi
isStarted = true;
configSync();
logger.info("Current configurations after the bootstrap sync." + LINE_SEPARATOR + register.toString());
LOGGER.info("Current configurations after the bootstrap sync." + LINE_SEPARATOR + register.toString());
Executors.newSingleThreadScheduledExecutor()
.scheduleAtFixedRate(
new RunnableWithExceptionProtection(
this::configSync,
t -> logger.error("Sync config center error.", t)
t -> LOGGER.error("Sync config center error.", t)
), syncPeriod, syncPeriod, TimeUnit.SECONDS);
}
......@@ -105,11 +105,11 @@ public abstract class ConfigWatcherRegister implements DynamicConfigurationServi
}
}
} else {
logger.warn("Config {} from configuration center, doesn't match any watcher, ignore.", itemName);
LOGGER.warn("Config {} from configuration center, doesn't match any watcher, ignore.", itemName);
}
});
logger.trace("Current configurations after the sync." + LINE_SEPARATOR + register.toString());
LOGGER.trace("Current configurations after the sync." + LINE_SEPARATOR + register.toString());
});
}
......
......@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
public class EtcdConfigWatcherRegister extends ConfigWatcherRegister {
private final static Logger logger = LoggerFactory.getLogger(EtcdConfigWatcherRegister.class);
private static final Logger LOGGER = LoggerFactory.getLogger(EtcdConfigWatcherRegister.class);
/**
* server settings for Etcd configuration
......@@ -126,8 +126,8 @@ public class EtcdConfigWatcherRegister extends ConfigWatcherRegister {
try {
EtcdKeysResponse.EtcdNode node = promise.get().getNode();
String value = node.getValue();
if (logger.isInfoEnabled()) {
logger.info("Etcd config changed: {}: {}", key, node.getValue());
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Etcd config changed: {}: {}", key, node.getValue());
}
configItemKeyedByName.put(key, Optional.ofNullable(value));
......
......@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
*/
public class EtcdConfigurationProvider extends AbstractConfigurationProvider {
private final static Logger logger = LoggerFactory.getLogger(EtcdConfigurationProvider.class);
private static final Logger LOGGER = LoggerFactory.getLogger(EtcdConfigurationProvider.class);
private EtcdServerSettings settings;
......@@ -41,7 +41,7 @@ public class EtcdConfigurationProvider extends AbstractConfigurationProvider {
@Override
protected ConfigWatcherRegister initConfigReader() throws ModuleStartException {
logger.info("settings: {}", settings);
LOGGER.info("settings: {}", settings);
if (Strings.isNullOrEmpty(settings.getServerAddr())) {
throw new ModuleStartException("Etcd serverAddr cannot be null or empty.");
}
......
......@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
*/
public class EtcdUtils {
private final static Logger logger = LoggerFactory.getLogger(EtcdUtils.class);
private static final Logger LOGGER = LoggerFactory.getLogger(EtcdUtils.class);
public EtcdUtils() {
}
......@@ -40,7 +40,7 @@ public class EtcdUtils {
public static List<URI> parse(EtcdServerSettings settings) {
List<URI> uris = new ArrayList<>();
try {
logger.info("etcd settings is {}", settings);
LOGGER.info("etcd settings is {}", settings);
List<Address> addressList = ConnectUtils.parse(settings.getServerAddr());
for (Address address : addressList) {
uris.add(new URI("http", null, address.getHost(), address.getPort(), null, null, null));
......@@ -55,7 +55,7 @@ public class EtcdUtils {
public static List<URI> parseProp(Properties properties) {
List<URI> uris = new ArrayList<>();
try {
logger.info("etcd server addr is {}", properties);
LOGGER.info("etcd server addr is {}", properties);
List<Address> addressList = ConnectUtils.parse(properties.getProperty("serverAddr"));
for (Address address : addressList) {
uris.add(new URI("http", null, address.getHost(), address.getPort(), null, null, null));
......
......@@ -45,7 +45,7 @@ import static org.junit.Assert.assertTrue;
public class ITEtcdConfigurationTest {
private static final Logger logger = LoggerFactory.getLogger(ITEtcdConfigurationTest.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ITEtcdConfigurationTest.class);
private final Yaml yaml = new Yaml();
......@@ -65,7 +65,7 @@ public class ITEtcdConfigurationTest {
final String etcdHost = System.getProperty("etcd.host");
final String etcdPort = System.getProperty("etcd.port");
logger.info("etcdHost: {}, etcdPort: {}", etcdHost, etcdPort);
LOGGER.info("etcdHost: {}, etcdPort: {}", etcdHost, etcdPort);
Properties properties = new Properties();
properties.setProperty("serverAddr", etcdHost + ":" + etcdPort);
......@@ -84,7 +84,7 @@ public class ITEtcdConfigurationTest {
assertTrue(publishConfig("test-module.default.testKey", "skywalking", "500"));
for (String v = provider.watcher.value(); v == null; v = provider.watcher.value()) {
logger.info("value is : {}", provider.watcher.value());
LOGGER.info("value is : {}", provider.watcher.value());
}
assertEquals("500", provider.watcher.value());
......
......@@ -31,7 +31,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GRPCConfigWatcherRegister extends ConfigWatcherRegister {
private static final Logger logger = LoggerFactory.getLogger(GRPCConfigWatcherRegister.class);
private static final Logger LOGGER = LoggerFactory.getLogger(GRPCConfigWatcherRegister.class);
private RemoteEndpointSettings settings;
private ConfigurationServiceGrpc.ConfigurationServiceBlockingStub stub;
......@@ -68,7 +68,7 @@ public class GRPCConfigWatcherRegister extends ConfigWatcherRegister {
}
});
} catch (Exception e) {
logger.error("Remote config center [" + settings + "] is not available.", e);
LOGGER.error("Remote config center [" + settings + "] is not available.", e);
}
return Optional.of(table);
}
......
......@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
* Locate the base work path of OAP backend.
*/
public class WorkPath {
private static final Logger logger = LoggerFactory.getLogger(WorkPath.class);
private static final Logger LOGGER = LoggerFactory.getLogger(WorkPath.class);
private static File PATH;
......@@ -47,7 +47,7 @@ public class WorkPath {
if (resource != null) {
String urlString = resource.toString();
logger.debug("The beacon class location is {}.", urlString);
LOGGER.debug("The beacon class location is {}.", urlString);
int insidePathIndex = urlString.indexOf('!');
boolean isInJar = insidePathIndex > -1;
......
......@@ -29,13 +29,13 @@ import org.slf4j.LoggerFactory;
*/
public class AlarmStandardPersistence implements AlarmCallback {
private static final Logger logger = LoggerFactory.getLogger(AlarmStandardPersistence.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AlarmStandardPersistence.class);
@Override
public void doAlarm(List<AlarmMessage> alarmMessage) {
alarmMessage.forEach(message -> {
if (logger.isDebugEnabled()) {
logger.debug("Alarm message: {}", message.getAlarmMessage());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Alarm message: {}", message.getAlarmMessage());
}
AlarmRecord record = new AlarmRecord();
......
......@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
public class DispatcherManager implements DispatcherDetectorListener {
private static final Logger logger = LoggerFactory.getLogger(DispatcherManager.class);
private static final Logger LOGGER = LoggerFactory.getLogger(DispatcherManager.class);
private Map<Integer, List<SourceDispatcher>> dispatcherMap;
......@@ -112,7 +112,7 @@ public class DispatcherManager implements DispatcherDetectorListener {
dispatchers.add(dispatcher);
logger.info("Dispatcher {} is added into DefaultScopeDefine {}.", dispatcher.getClass()
LOGGER.info("Dispatcher {} is added into DefaultScopeDefine {}.", dispatcher.getClass()
.getName(), scopeId);
}
}
......
......@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
public class RecordPersistentWorker extends AbstractWorker<Record> {
private static final Logger logger = LoggerFactory.getLogger(RecordPersistentWorker.class);
private static final Logger LOGGER = LoggerFactory.getLogger(RecordPersistentWorker.class);
private final Model model;
private final IRecordDAO recordDAO;
......@@ -51,7 +51,7 @@ public class RecordPersistentWorker extends AbstractWorker<Record> {
InsertRequest insertRequest = recordDAO.prepareBatchInsert(model, record);
batchDAO.asynchronous(insertRequest);
} catch (IOException e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
}
}
}
......@@ -32,7 +32,7 @@ import org.yaml.snakeyaml.Yaml;
* which declare the real server type based on client component.
*/
public class ComponentLibraryCatalogService implements IComponentLibraryCatalogService {
private static final Logger logger = LoggerFactory.getLogger(ComponentLibraryCatalogService.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ComponentLibraryCatalogService.class);
private static final String COMPONENT_SERVER_MAPPING_SECTION = "Component-Server-Mappings";
private Map<String, Integer> componentName2Id;
......@@ -107,7 +107,7 @@ public class ComponentLibraryCatalogService implements IComponentLibraryCatalogS
});
nameMapping.clear();
} catch (FileNotFoundException e) {
logger.error("component-libraries.yml not found.", e);
LOGGER.error("component-libraries.yml not found.", e);
}
}
......
......@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
* provides several routing mode to select target OAP node.
*/
public class RemoteSenderService implements Service {
private static final Logger logger = LoggerFactory.getLogger(RemoteSenderService.class);
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteSenderService.class);
private final ModuleManager moduleManager;
private final HashCodeSelector hashCodeSelector;
......@@ -66,7 +66,7 @@ public class RemoteSenderService implements Service {
List<RemoteClient> clientList = clientManager.getRemoteClient();
if (clientList.size() == 0) {
logger.warn(
LOGGER.warn(
"There is no available remote server for now, ignore the streaming data until the cluster metadata initialized.");
return;
}
......
......@@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
*/
public class RemoteServiceHandler extends RemoteServiceGrpc.RemoteServiceImplBase implements GRPCHandler {
private static final Logger logger = LoggerFactory.getLogger(RemoteServiceHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteServiceHandler.class);
private final ModuleDefineHolder moduleDefineHolder;
private IWorkerInstanceGetter workerInstanceGetter;
......@@ -125,14 +125,14 @@ public class RemoteServiceHandler extends RemoteServiceGrpc.RemoteServiceImplBas
nextWorker.in(streamData);
} else {
remoteInTargetNotFoundCounter.inc();
logger.warn(
LOGGER.warn(
"Work name [{}] not found. Check OAL script, make sure they are same in the whole cluster.",
nextWorkerName
);
}
} catch (Throwable t) {
remoteInErrorCounter.inc();
logger.error(t.getMessage(), t);
LOGGER.error(t.getMessage(), t);
}
} finally {
timer.finish();
......@@ -141,7 +141,7 @@ public class RemoteServiceHandler extends RemoteServiceGrpc.RemoteServiceImplBas
@Override
public void onError(Throwable throwable) {
logger.error(throwable.getMessage(), throwable);
LOGGER.error(throwable.getMessage(), throwable);
}
@Override
......
......@@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
*/
public class GRPCRemoteClient implements RemoteClient {
private static final Logger logger = LoggerFactory.getLogger(GRPCRemoteClient.class);
private static final Logger LOGGER = LoggerFactory.getLogger(GRPCRemoteClient.class);
private final int channelSize;
private final int bufferSize;
......@@ -160,13 +160,13 @@ public class GRPCRemoteClient implements RemoteClient {
streamObserver.onCompleted();
} catch (Throwable t) {
remoteOutErrorCounter.inc();
logger.error(t.getMessage(), t);
LOGGER.error(t.getMessage(), t);
}
}
@Override
public void onError(List<RemoteMessage> remoteMessages, Throwable t) {
logger.error(t.getMessage(), t);
LOGGER.error(t.getMessage(), t);
}
@Override
......@@ -189,13 +189,13 @@ public class GRPCRemoteClient implements RemoteClient {
try {
Thread.sleep(sleepMillis);
} catch (InterruptedException e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
}
sleepTotalMillis += sleepMillis;
if (sleepTotalMillis > 60000) {
logger.warn("Remote client block times over 60 seconds.");
LOGGER.warn("Remote client block times over 60 seconds.");
}
}
......@@ -207,7 +207,7 @@ public class GRPCRemoteClient implements RemoteClient {
@Override
public void onError(Throwable throwable) {
concurrentStreamObserverNumber.addAndGet(-1);
logger.error(throwable.getMessage(), throwable);
LOGGER.error(throwable.getMessage(), throwable);
}
@Override
......
......@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
*/
public class RemoteClientManager implements Service {
private static final Logger logger = LoggerFactory.getLogger(RemoteClientManager.class);
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteClientManager.class);
private final ModuleDefineHolder moduleDefineHolder;
private SslContext sslContext;
......@@ -121,8 +121,8 @@ public class RemoteClientManager implements Service {
}
}
if (logger.isDebugEnabled()) {
logger.debug("Refresh remote nodes collection.");
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Refresh remote nodes collection.");
}
List<RemoteInstance> instanceList = clusterNodesQuery.queryRemoteNodes();
......@@ -131,20 +131,20 @@ public class RemoteClientManager implements Service {
gauge.setValue(instanceList.size());
if (logger.isDebugEnabled()) {
instanceList.forEach(instance -> logger.debug("Cluster instance: {}", instance.toString()));
if (LOGGER.isDebugEnabled()) {
instanceList.forEach(instance -> LOGGER.debug("Cluster instance: {}", instance.toString()));
}
if (!compare(instanceList)) {
if (logger.isDebugEnabled()) {
logger.debug("ReBuilding remote clients.");
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("ReBuilding remote clients.");
}
reBuildRemoteClients(instanceList);
}
printRemoteClientList();
} catch (Throwable t) {
logger.error(t.getMessage(), t);
LOGGER.error(t.getMessage(), t);
}
}
......@@ -152,10 +152,10 @@ public class RemoteClientManager implements Service {
* Print the client list into log for confirm how many clients built.
*/
private void printRemoteClientList() {
if (logger.isDebugEnabled()) {
if (LOGGER.isDebugEnabled()) {
StringBuilder addresses = new StringBuilder();
this.usingClients.forEach(client -> addresses.append(client.getAddress().toString()).append(","));
logger.debug("Remote client list: {}", addresses);
LOGGER.debug("Remote client list: {}", addresses);
}
}
......
......@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
public class HealthCheckServiceHandler extends HealthGrpc.HealthImplBase implements GRPCHandler {
private static final Logger logger = LoggerFactory.getLogger(HealthCheckServiceHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(HealthCheckServiceHandler.class);
/**
* By my test, consul didn't send the service.
......@@ -39,8 +39,8 @@ public class HealthCheckServiceHandler extends HealthGrpc.HealthImplBase impleme
public void check(HealthCheckService.HealthCheckRequest request,
StreamObserver<HealthCheckService.HealthCheckResponse> responseObserver) {
if (logger.isDebugEnabled()) {
logger.debug("Received the gRPC server health check with the service name of {}", request.getService());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Received the gRPC server health check with the service name of {}", request.getService());
}
HealthCheckService.HealthCheckResponse.Builder response = HealthCheckService.HealthCheckResponse.newBuilder();
......
......@@ -26,12 +26,12 @@ import org.slf4j.LoggerFactory;
public class ForeverFirstSelector implements RemoteClientSelector {
private static final Logger logger = LoggerFactory.getLogger(ForeverFirstSelector.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ForeverFirstSelector.class);
@Override
public RemoteClient select(List<RemoteClient> clients, StreamData streamData) {
if (logger.isDebugEnabled()) {
logger.debug("clients size: {}", clients.size());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("clients size: {}", clients.size());
}
return clients.get(0);
}
......
......@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
* Worker Instance Service hosts all remote handler workers with the stream data type.
*/
public class WorkerInstancesService implements IWorkerInstanceSetter, IWorkerInstanceGetter {
private static final Logger logger = LoggerFactory.getLogger(WorkerInstancesService.class);
private static final Logger LOGGER = LoggerFactory.getLogger(WorkerInstancesService.class);
private final Map<String, RemoteHandleWorker> instances;
......@@ -49,6 +49,6 @@ public class WorkerInstancesService implements IWorkerInstanceSetter, IWorkerIns
throw new UnexpectedException("Duplicate worker name:" + remoteReceiverWorkName);
}
instances.put(remoteReceiverWorkName, new RemoteHandleWorker(instance, streamDataClass));
logger.debug("Worker {} has been registered as {}", instance.toString(), remoteReceiverWorkName);
LOGGER.debug("Worker {} has been registered as {}", instance.toString(), remoteReceiverWorkName);
}
}
......@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
public class GRPCClient implements Client {
private static final Logger logger = LoggerFactory.getLogger(GRPCClient.class);
private static final Logger LOGGER = LoggerFactory.getLogger(GRPCClient.class);
@Getter
private final String host;
......@@ -65,7 +65,7 @@ public class GRPCClient implements Client {
try {
channel.shutdownNow();
} catch (Throwable t) {
logger.error(t.getMessage(), t);
LOGGER.error(t.getMessage(), t);
}
}
......
......@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
* JDBC Client uses HikariCP connection management lib to execute SQL.
*/
public class JDBCHikariCPClient implements Client, HealthCheckable {
private static final Logger logger = LoggerFactory.getLogger(JDBCHikariCPClient.class);
private static final Logger LOGGER = LoggerFactory.getLogger(JDBCHikariCPClient.class);
private final HikariConfig hikariConfig;
private final DelegatedHealthChecker healthChecker;
......@@ -80,7 +80,7 @@ public class JDBCHikariCPClient implements Client, HealthCheckable {
}
public void execute(Connection connection, String sql) throws JDBCClientException {
logger.debug("execute aql: {}", sql);
LOGGER.debug("execute aql: {}", sql);
try (Statement statement = connection.createStatement()) {
statement.execute(sql);
healthChecker.health();
......@@ -91,7 +91,7 @@ public class JDBCHikariCPClient implements Client, HealthCheckable {
}
public boolean execute(Connection connection, String sql, Object... params) throws JDBCClientException {
logger.debug("execute query with result: {}", sql);
LOGGER.debug("execute query with result: {}", sql);
boolean result;
PreparedStatement statement = null;
try {
......@@ -115,7 +115,7 @@ public class JDBCHikariCPClient implements Client, HealthCheckable {
}
public ResultSet executeQuery(Connection connection, String sql, Object... params) throws JDBCClientException {
logger.debug("execute query with result: {}", sql);
LOGGER.debug("execute query with result: {}", sql);
ResultSet rs;
PreparedStatement statement = null;
try {
......
......@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
public class ITElasticSearchClient {
private static final Logger logger = LoggerFactory.getLogger(ITElasticSearchClient.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ITElasticSearchClient.class);
private ElasticSearchClient client;
......@@ -99,7 +99,7 @@ public class ITElasticSearchClient {
Assert.assertTrue(client.isExistsIndex(indexName));
JsonObject index = getIndex(indexName);
logger.info(index.toString());
LOGGER.info(index.toString());
Assert.assertEquals(2, index.getAsJsonObject(indexName)
.getAsJsonObject("settings")
......@@ -184,7 +184,7 @@ public class ITElasticSearchClient {
client.forceInsert(indexName + "-2019", "testid", builder);
JsonObject index = getIndex(indexName + "-2019");
logger.info(index.toString());
LOGGER.info(index.toString());
Assert.assertEquals(1, index.getAsJsonObject(indexName + "-2019")
.getAsJsonObject("settings")
......@@ -265,7 +265,7 @@ public class ITElasticSearchClient {
private JsonObject undoFormatIndexName(JsonObject index) {
if (StringUtil.isNotEmpty(namespace) && index != null && index.size() > 0) {
logger.info("UndoFormatIndexName before " + index.toString());
LOGGER.info("UndoFormatIndexName before " + index.toString());
String namespacePrefix = namespace + "_";
index.entrySet().forEach(entry -> {
String oldIndexName = entry.getKey();
......@@ -278,7 +278,7 @@ public class ITElasticSearchClient {
.getKey());
}
});
logger.info("UndoFormatIndexName after " + index.toString());
LOGGER.info("UndoFormatIndexName after " + index.toString());
}
return index;
}
......
......@@ -27,7 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class BootstrapFlow {
private static final Logger logger = LoggerFactory.getLogger(BootstrapFlow.class);
private static final Logger LOGGER = LoggerFactory.getLogger(BootstrapFlow.class);
private Map<String, ModuleDefine> loadedModules;
private List<ModuleProvider> startupSequence;
......@@ -52,7 +52,7 @@ class BootstrapFlow {
}
}
}
logger.info("start the provider {} in {} module.", provider.name(), provider.getModuleName());
LOGGER.info("start the provider {} in {} module.", provider.name(), provider.getModuleName());
provider.requiredCheck(provider.getModule().services());
provider.start();
......
......@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
*/
public abstract class ModuleDefine implements ModuleProviderHolder {
private static final Logger logger = LoggerFactory.getLogger(ModuleDefine.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ModuleDefine.class);
private ModuleProvider loadedProvider = null;
......@@ -42,6 +42,7 @@ public abstract class ModuleDefine implements ModuleProviderHolder {
/**
* @return the module name
*
*/
public final String name() {
return name;
......@@ -85,7 +86,7 @@ public abstract class ModuleDefine implements ModuleProviderHolder {
throw new ProviderNotFoundException(this.name() + " module no provider exists.");
}
logger.info("Prepare the {} provider in {} module.", loadedProvider.name(), this.name());
LOGGER.info("Prepare the {} provider in {} module.", loadedProvider.name(), this.name());
try {
copyProperties(loadedProvider.createConfigBeanIfAbsent(), configuration.getProviderConfiguration(loadedProvider
.name()), this.name(), loadedProvider.name());
......@@ -109,7 +110,7 @@ public abstract class ModuleDefine implements ModuleProviderHolder {
field.setAccessible(true);
field.set(dest, src.get(propertyName));
} catch (NoSuchFieldException e) {
logger.warn(propertyName + " setting is not supported in " + providerName + " provider of " + moduleName + " module");
LOGGER.warn(propertyName + " setting is not supported in " + providerName + " provider of " + moduleName + " module");
}
}
}
......
......@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
public class GRPCServer implements Server {
private static final Logger logger = LoggerFactory.getLogger(GRPCServer.class);
private static final Logger LOGGER = LoggerFactory.getLogger(GRPCServer.class);
private final String host;
private final int port;
......@@ -109,14 +109,14 @@ public class GRPCServer implements Server {
nettyServerBuilder = nettyServerBuilder.maxConcurrentCallsPerConnection(maxConcurrentCallsPerConnection)
.maxInboundMessageSize(maxMessageSize)
.executor(executor);
logger.info("Server started, host {} listening on {}", host, port);
LOGGER.info("Server started, host {} listening on {}", host, port);
}
static class CustomRejectedExecutionHandler implements RejectedExecutionHandler {
@Override
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
logger.warn("Grpc server thread pool is full, rejecting the task");
LOGGER.warn("Grpc server thread pool is full, rejecting the task");
}
}
......@@ -135,12 +135,12 @@ public class GRPCServer implements Server {
}
public void addHandler(BindableService handler) {
logger.info("Bind handler {} into gRPC server {}:{}", handler.getClass().getSimpleName(), host, port);
LOGGER.info("Bind handler {} into gRPC server {}:{}", handler.getClass().getSimpleName(), host, port);
nettyServerBuilder.addService(handler);
}
public void addHandler(ServerServiceDefinition definition) {
logger.info("Bind handler {} into gRPC server {}:{}", definition.getClass().getSimpleName(), host, port);
LOGGER.info("Bind handler {} into gRPC server {}:{}", definition.getClass().getSimpleName(), host, port);
nettyServerBuilder.addService(definition);
}
......
......@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
import static java.util.Objects.nonNull;
public abstract class JettyJsonHandler extends JettyHandler {
private static final Logger logger = LoggerFactory.getLogger(JettyJsonHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(JettyJsonHandler.class);
@Override
protected final void doGet(HttpServletRequest req, HttpServletResponse resp) {
......@@ -46,7 +46,7 @@ public abstract class JettyJsonHandler extends JettyHandler {
try {
replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
} catch (IOException replyException) {
logger.error(replyException.getMessage(), e);
LOGGER.error(replyException.getMessage(), e);
}
}
}
......@@ -61,7 +61,7 @@ public abstract class JettyJsonHandler extends JettyHandler {
try {
replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
} catch (IOException replyException) {
logger.error(replyException.getMessage(), e);
LOGGER.error(replyException.getMessage(), e);
}
}
}
......
......@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
public class JettyServer implements Server {
private static final Logger logger = LoggerFactory.getLogger(JettyServer.class);
private static final Logger LOGGER = LoggerFactory.getLogger(JettyServer.class);
private org.eclipse.jetty.server.Server server;
private ServletContextHandler servletContextHandler;
......@@ -70,13 +70,13 @@ public class JettyServer implements Server {
servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
servletContextHandler.setContextPath(jettyServerConfig.getContextPath());
logger.info("http server root context path: {}", jettyServerConfig.getContextPath());
LOGGER.info("http server root context path: {}", jettyServerConfig.getContextPath());
server.setHandler(servletContextHandler);
}
public void addHandler(JettyHandler handler) {
logger.info(
LOGGER.info(
"Bind handler {} into jetty server {}:{}",
handler.getClass().getSimpleName(), jettyServerConfig.getHost(), jettyServerConfig.getPort()
);
......@@ -98,14 +98,14 @@ public class JettyServer implements Server {
@Override
public void start() throws ServerException {
logger.info("start server, host: {}, port: {}", jettyServerConfig.getHost(), jettyServerConfig.getPort());
LOGGER.info("start server, host: {}, port: {}", jettyServerConfig.getHost(), jettyServerConfig.getPort());
try {
if (logger.isDebugEnabled()) {
if (LOGGER.isDebugEnabled()) {
if (servletContextHandler.getServletHandler() != null && servletContextHandler.getServletHandler()
.getServletMappings() != null) {
for (ServletMapping servletMapping : servletContextHandler.getServletHandler()
.getServletMappings()) {
logger.debug(
LOGGER.debug(
"jetty servlet mappings: {} register by {}", servletMapping.getPathSpecs(), servletMapping
.getServletName());
}
......
......@@ -25,11 +25,11 @@ import org.slf4j.LoggerFactory;
public class TimestampUtils {
private static final Logger logger = LoggerFactory.getLogger(TimestampUtils.class);
private static final Logger LOGGER = LoggerFactory.getLogger(TimestampUtils.class);
public static void main(String[] args) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Timestamp timestamp = new Timestamp(1483200061001L);
logger.info("time: {}", format.format(timestamp));
LOGGER.info("time: {}", format.format(timestamp));
}
}
......@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
@RequiredArgsConstructor
public class GraphQLQueryHandler extends JettyJsonHandler {
private static final Logger logger = LoggerFactory.getLogger(GraphQLQueryHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLQueryHandler.class);
private static final String QUERY = "query";
private static final String VARIABLES = "variables";
......@@ -91,7 +91,7 @@ public class GraphQLQueryHandler extends JettyJsonHandler {
.variables(variables)
.build();
ExecutionResult executionResult = graphQL.execute(executionInput);
logger.debug("Execution result is {}", executionResult);
LOGGER.debug("Execution result is {}", executionResult);
Object data = executionResult.getData();
List<GraphQLError> errors = executionResult.getErrors();
JsonObject jsonObject = new JsonObject();
......@@ -110,7 +110,7 @@ public class GraphQLQueryHandler extends JettyJsonHandler {
}
return jsonObject;
} catch (final Throwable e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
JsonObject jsonObject = new JsonObject();
JsonArray errorArray = new JsonArray();
JsonObject errorJson = new JsonObject();
......
......@@ -40,7 +40,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AccessLogServiceGRPCHandler extends AccessLogServiceGrpc.AccessLogServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(AccessLogServiceGRPCHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AccessLogServiceGRPCHandler.class);
private final List<ALSHTTPAnalysis> envoyHTTPAnalysisList;
private final SourceReceiver sourceReceiver;
private final CounterMetrics counter;
......@@ -59,7 +59,7 @@ public class AccessLogServiceGRPCHandler extends AccessLogServiceGrpc.AccessLogS
}
}
logger.debug("envoy HTTP analysis: " + envoyHTTPAnalysisList);
LOGGER.debug("envoy HTTP analysis: " + envoyHTTPAnalysisList);
sourceReceiver = manager.find(CoreModule.NAME).provider().getService(SourceReceiver.class);
......@@ -93,8 +93,8 @@ public class AccessLogServiceGRPCHandler extends AccessLogServiceGrpc.AccessLogS
StreamAccessLogsMessage.LogEntriesCase logCase = message.getLogEntriesCase();
if (logger.isDebugEnabled()) {
logger.debug("Messaged is identified from Envoy[{}], role[{}] in [{}]. Received msg {}", identifier
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Messaged is identified from Envoy[{}], role[{}] in [{}]. Received msg {}", identifier
.getNode()
.getId(), role, logCase, message);
}
......@@ -120,7 +120,7 @@ public class AccessLogServiceGRPCHandler extends AccessLogServiceGrpc.AccessLogS
@Override
public void onError(Throwable throwable) {
logger.error("Error in receiving access log from envoy", throwable);
LOGGER.error("Error in receiving access log from envoy", throwable);
responseObserver.onCompleted();
}
......
......@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
interface Fetcher extends Function<V1OwnerReference, Optional<V1ObjectMeta>> {
Logger logger = LoggerFactory.getLogger(Fetcher.class);
Logger LOGGER = LoggerFactory.getLogger(Fetcher.class);
V1ObjectMeta go(V1OwnerReference ownerReference) throws ApiException;
......@@ -37,10 +37,10 @@ interface Fetcher extends Function<V1OwnerReference, Optional<V1ObjectMeta>> {
try {
return Optional.ofNullable(go(ownerReference));
} catch (final ApiException e) {
logger.error("code:{} header:{} body:{}", e.getCode(), e.getResponseHeaders(), e.getResponseBody());
LOGGER.error("code:{} header:{} body:{}", e.getCode(), e.getResponseHeaders(), e.getResponseBody());
return Optional.empty();
} catch (final Throwable th) {
logger.error("other errors", th);
LOGGER.error("other errors", th);
return Optional.empty();
}
}
......
......@@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory;
* Analysis log based on ingress and mesh scenarios.
*/
public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
private static final Logger logger = LoggerFactory.getLogger(K8sALSServiceMeshHTTPAnalysis.class);
private static final Logger LOGGER = LoggerFactory.getLogger(K8sALSServiceMeshHTTPAnalysis.class);
private static final String ADDRESS_TYPE_INTERNAL_IP = "InternalIP";
......@@ -102,13 +102,13 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
long startTime = System.nanoTime();
for (V1Pod item : list.getItems()) {
if (!item.getStatus().getPhase().equals(VALID_PHASE)) {
logger.debug("Invalid pod {} is not in a valid phase {}", item.getMetadata()
LOGGER.debug("Invalid pod {} is not in a valid phase {}", item.getMetadata()
.getName(), item.getStatus()
.getPhase());
continue;
}
if (item.getStatus().getPodIP().equals(item.getStatus().getHostIP())) {
logger.debug(
LOGGER.debug(
"Pod {}.{} is removed because hostIP and podIP are identical ", item.getMetadata()
.getName(),
item.getMetadata()
......@@ -118,10 +118,10 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
}
ipMap.put(item.getStatus().getPodIP(), createServiceMetaInfo(item.getMetadata()));
}
logger.info("Load {} pods in {}ms", ipMap.size(), (System.nanoTime() - startTime) / 1_000_000);
LOGGER.info("Load {} pods in {}ms", ipMap.size(), (System.nanoTime() - startTime) / 1_000_000);
ipServiceMap.set(ipMap);
} catch (Throwable th) {
logger.error("run load pod error", th);
LOGGER.error("run load pod error", th);
}
}
......@@ -231,7 +231,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
.setProtocol(protocol)
.setDetectPoint(DetectPoint.server);
logger.debug("Transformed ingress->sidecar inbound mesh metric {}", metric);
LOGGER.debug("Transformed ingress->sidecar inbound mesh metric {}", metric);
forward(metric);
} else {
// sidecar -> sidecar(server side)
......@@ -254,7 +254,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
.setProtocol(protocol)
.setDetectPoint(DetectPoint.server);
logger.debug("Transformed sidecar->sidecar(server side) inbound mesh metric {}", metric);
LOGGER.debug("Transformed sidecar->sidecar(server side) inbound mesh metric {}", metric);
forward(metric);
}
} else if (cluster.startsWith("outbound|")) {
......@@ -283,7 +283,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
.setProtocol(protocol)
.setDetectPoint(DetectPoint.client);
logger.debug("Transformed sidecar->sidecar(server side) inbound mesh metric {}", metric);
LOGGER.debug("Transformed sidecar->sidecar(server side) inbound mesh metric {}", metric);
forward(metric);
}
......@@ -347,7 +347,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
.setProtocol(protocol)
.setDetectPoint(DetectPoint.server);
logger.debug("Transformed ingress inbound mesh metric {}", metric);
LOGGER.debug("Transformed ingress inbound mesh metric {}", metric);
forward(metric);
SocketAddress upstreamRemoteAddressSocketAddress = upstreamRemoteAddress.getSocketAddress();
......@@ -378,7 +378,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
.setProtocol(protocol)
.setDetectPoint(DetectPoint.client);
logger.debug("Transformed ingress outbound mesh metric {}", outboundMetric);
LOGGER.debug("Transformed ingress outbound mesh metric {}", outboundMetric);
forward(outboundMetric);
}
}
......@@ -407,13 +407,13 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
protected ServiceMetaInfo find(String ip, int port) {
Map<String, ServiceMetaInfo> map = ipServiceMap.get();
if (map == null) {
logger.debug("Unknown ip {}, ip -> service is null", ip);
LOGGER.debug("Unknown ip {}, ip -> service is null", ip);
return ServiceMetaInfo.UNKNOWN;
}
if (map.containsKey(ip)) {
return map.get(ip);
}
logger.debug("Unknown ip {}, ip -> service is {}", ip, map);
LOGGER.debug("Unknown ip {}, ip -> service is {}", ip, map);
return ServiceMetaInfo.UNKNOWN;
}
......
......@@ -36,7 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JaegerGRPCHandler extends CollectorServiceGrpc.CollectorServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(JaegerGRPCHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(JaegerGRPCHandler.class);
private SourceReceiver receiver;
private JaegerReceiverConfig config;
......@@ -51,8 +51,8 @@ public class JaegerGRPCHandler extends CollectorServiceGrpc.CollectorServiceImpl
request.getBatch().getSpansList().forEach(span -> {
try {
if (logger.isDebugEnabled()) {
logger.debug(span.toString());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(span.toString());
}
JaegerSpan jaegerSpan = new JaegerSpan();
......@@ -97,7 +97,7 @@ public class JaegerGRPCHandler extends CollectorServiceGrpc.CollectorServiceImpl
receiver.receive(jaegerSpan);
} catch (Exception e) {
logger.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
}
});
......
......@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
**/
public class CLRSourceDispatcher {
private static final Logger logger = LoggerFactory.getLogger(CLRSourceDispatcher.class);
private static final Logger LOGGER = LoggerFactory.getLogger(CLRSourceDispatcher.class);
private final SourceReceiver sourceReceiver;
public CLRSourceDispatcher(ModuleManager moduleManager) {
......
......@@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
*/
public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMetricServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(IstioTelemetryGRPCHandler.class);
private static final Logger LOGGER = LoggerFactory.getLogger(IstioTelemetryGRPCHandler.class);
private static final Joiner JOINER = Joiner.on(".");
......@@ -64,8 +64,8 @@ public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMet
@Override
public void handleMetric(IstioMetricProto.HandleMetricRequest request,
StreamObserver<ReportProto.ReportResult> responseObserver) {
if (logger.isDebugEnabled()) {
logger.debug("Received msg {}", request);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Received msg {}", request);
}
for (IstioMetricProto.InstanceMsg i : request.getInstancesList()) {
counter.inc();
......@@ -130,7 +130,7 @@ public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMet
.setStatus(status)
.setProtocol(netProtocol)
.setDetectPoint(detectPoint);
logger.debug("Transformed metrics {}", metrics);
LOGGER.debug("Transformed metrics {}", metrics);
TelemetryDataDispatcher.process(metrics);
} finally {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册