Skip to content

Commit

Permalink
Merge pull request #473 from Aiven-Open/jeqo/reduce-cache-logging
Browse files Browse the repository at this point in the history
chore: reduce logging
  • Loading branch information
AnatolyPopov authored Jan 2, 2024
2 parents be9637d + 9b37f79 commit f4a344f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public Path cacheChunk(final ChunkKey chunkKey, final InputStream chunk) throws
final var chunkKeyPath = chunkKey.path();
final Path tempChunkPath = config.tempCachePath().resolve(chunkKeyPath);
final Path tempCached = writeToDisk(chunk, tempChunkPath);
log.debug("Chunk file has been stored to temporary caching directory {}", tempCached);
log.trace("Chunk file has been stored to temporary caching directory {}", tempCached);
final Path cachedChunkPath = config.cachePath().resolve(chunkKeyPath);
try {
final Path newPath = Files.move(tempCached, cachedChunkPath, ATOMIC_MOVE);
log.debug("Chunk file has been moved to cache directory {}", newPath);
log.trace("Chunk file has been moved to cache directory {}", newPath);
return newPath;
} finally {
// In case of exception during the move, the chunk file should be cleaned from temporary cache directory.
Expand All @@ -101,7 +101,7 @@ public RemovalListener<ChunkKey, Path> removalListener() {
final long fileSize = Files.size(path);
Files.delete(path);
metrics.chunkDeleted(fileSize);
log.debug("Deleted cached file for key {} with path {} from cache directory."
log.trace("Deleted cached file for key {} with path {} from cache directory."
+ " The reason of the deletion is {}", key, path, cause);
} else {
log.warn("Path not present when trying to delete cached file for key {} from cache directory."
Expand Down

0 comments on commit f4a344f

Please sign in to comment.