Skip to content

Commit

Permalink
Fix log message format bugs (elastic#118354)
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Dec 10, 2024
1 parent 04d01fe commit 009ab18
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/118354.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118354
summary: Fix log message format bugs
area: Ingest Node
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ public void onResponse(Void unused) {
// should be no other processes interacting with the repository.
logger.warn(
Strings.format(
"failed to clean up multipart upload [{}] of blob [{}][{}][{}]",
"failed to clean up multipart upload [%s] of blob [%s][%s][%s]",
abortMultipartUploadRequest.getUploadId(),
blobStore.getRepositoryMetadata().name(),
abortMultipartUploadRequest.getBucketName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private String getRollupIndexName() throws IOException {
if (asMap.size() == 1) {
return (String) asMap.keySet().toArray()[0];
}
logger.warn("--> No matching rollup name for path [%s]", endpoint);
logger.warn("--> No matching rollup name for path [{}]", endpoint);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private String getRollupIndexName() throws IOException {
if (asMap.size() == 1) {
return (String) asMap.keySet().toArray()[0];
}
logger.warn("--> No matching rollup name for path [%s]", endpoint);
logger.warn("--> No matching rollup name for path [{}]", endpoint);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public void testRetentionLeasesSyncOnRecovery() throws Exception {
.getShardOrNull(new ShardId(resolveIndex("index"), 0));
final int length = randomIntBetween(1, 8);
final Map<String, RetentionLease> currentRetentionLeases = new LinkedHashMap<>();
logger.info("adding retention [{}}] leases", length);
logger.info("adding retention [{}] leases", length);
for (int i = 0; i < length; i++) {
final String id = randomValueOtherThanMany(currentRetentionLeases.keySet()::contains, () -> randomAlphaOfLength(8));
final long retainingSequenceNumber = randomLongBetween(0, Long.MAX_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public void collect(int docId, long owningBucketOrd) throws IOException {

if (logger.isTraceEnabled()) {
logger.trace(
"Doc: [{}] - _tsid: [{}], @timestamp: [{}}] -> downsample bucket ts: [{}]",
"Doc: [{}] - _tsid: [{}], @timestamp: [{}] -> downsample bucket ts: [{}]",
docId,
DocValueFormat.TIME_SERIES_ID.format(tsidHash),
timestampFormat.format(timestamp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public EnrichPlugin(final Settings settings) {
if (settings.hasValue(CACHE_SIZE_SETTING_NAME)) {
throw new IllegalArgumentException(
Strings.format(
"Both [{}] and [{}] are set, please use [{}]",
"Both [%s] and [%s] are set, please use [%s]",
CACHE_SIZE_SETTING_NAME,
CACHE_SIZE_SETTING_BWC_NAME,
CACHE_SIZE_SETTING_NAME
Expand Down

0 comments on commit 009ab18

Please sign in to comment.