Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log improvement #11753

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ private void initConnectionRule() {
&& ruleStorageProxy.getExternalStorage().getConnectionRule() != null) {
localRuleContent = ruleStorageProxy.getExternalStorage().getConnectionRule();
if (StringUtils.isNotBlank(localRuleContent)) {
Loggers.CONTROL
.info("Found persist disk connection rule content on start up ,value ={}", localRuleContent);
Loggers.CONTROL.info("Found persist disk connection rule content on start up ,value ={}",
localRuleContent);
}
}

Expand Down Expand Up @@ -139,9 +139,7 @@ public void run() {
Collectors.toMap(ConnectionMetricsCollector::getName, ConnectionMetricsCollector::getTotalCount));
int totalCount = metricsTotalCount.values().stream().mapToInt(Integer::intValue).sum();

Loggers.CONNECTION.info(String.format("ConnectionMetrics, totalCount = %s, detail = %s", totalCount,
metricsTotalCount.toString()));

Loggers.CONNECTION.info("ConnectionMetrics, totalCount = {}, detail = {}", totalCount, metricsTotalCount);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public DefaultConnectionControlManager() {
@Override
public void applyConnectionLimitRule(ConnectionControlRule connectionControlRule) {
super.connectionControlRule = connectionControlRule;
Loggers.CONTROL.info("Connection control rule updated to ->" + (this.connectionControlRule == null ? null
: JacksonUtils.toJson(this.connectionControlRule)));
Loggers.CONTROL.info("Connection control rule updated to -> {}",
(this.connectionControlRule == null ? null : JacksonUtils.toJson(this.connectionControlRule)));
Loggers.CONTROL.warn("Connection control updated, But connection control manager is no limit implementation.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public void onEvent(TpsControlRuleChangeEvent event) {
String persistTpsRule = ruleStorageProxy.getExternalStorage().getTpsRule(pointName);
ruleStorageProxy.getLocalDiskStorage().saveTpsRule(pointName, persistTpsRule);
} else {
Loggers.CONTROL
.info("No external rule storage found,will load local disk instead,point name={}",
event.getPointName());
Loggers.CONTROL.info(
"No external rule storage found,will load local disk instead,point name={}",
event.getPointName());
}

}
Expand Down Expand Up @@ -114,7 +114,7 @@ public void onEvent(ConnectionLimitRuleChangeEvent event) {
}
String limitRule = ruleStorageProxy.getLocalDiskStorage().getConnectionRule();

Loggers.CONTROL.info("start to apply connection rule content " + limitRule);
Loggers.CONTROL.info("start to apply connection rule content {}", limitRule);
ConnectionControlManager controlManager = ControlManagerCenter.getInstance()
.getConnectionControlManager();
ConnectionControlRule connectionControlRule =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void saveConnectionRule(String ruleContent) throws IOException {
pointFile.createNewFile();
}
DiskUtils.writeFile(pointFile, ruleContent.getBytes(Constants.ENCODE), false);
LOGGER.info("Save connection rule to local,pointName={}, ruleContent ={} ", ruleContent);
LOGGER.info("Save connection rule to local, ruleContent ={} ", ruleContent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected void initTpsRule(String pointName) {
TpsControlRule tpsLimitRule = tpsControlRuleParser.parseRule(localRuleContent);
this.applyTpsRule(pointName, tpsLimitRule);
} else {
Loggers.CONTROL.info("No tps control rule of {} found ", pointName, localRuleContent);
Loggers.CONTROL.info("No tps control rule of {} found,content ={} ", pointName, localRuleContent);
}
}

Expand Down
Loading