Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.4.0
Description
There are many irregular debug logs in NameNode. such as:
Error type1:
if (LOG.isDebugEnabled()) { LOG.debug("Getting groups for user " + user); }
we can format it to:
LOG.debug("Getting groups for user {}. ", user);
Error type2:
LOG.debug("*DIR* NameNode.renameSnapshot: Snapshot Path {}, " + "snapshotOldName {}, snapshotNewName {}", snapshotRoot, snapshotOldName, snapshotNewName);
we can format it to:
if (LOG.isDebugEnabled()) { LOG.debug("*DIR* NameNode.renameSnapshot: Snapshot Path {}, " + "snapshotOldName {}, snapshotNewName {}", snapshotRoot, snapshotOldName, snapshotNewName); }
Error type3:
if (LOG.isDebugEnabled()) { LOG.debug("getAdditionalDatanode: src=" + src + ", fileId=" + fileId + ", blk=" + blk + ", existings=" + Arrays.asList(existings) + ", excludes=" + Arrays.asList(excludes) + ", numAdditionalNodes=" + numAdditionalNodes + ", clientName=" + clientName); }
We can format it to:
if (LOG.isDebugEnabled()) { LOG.debug("getAdditionalDatanode: src={}, fileId={}, " + "blk={}, existings={}, excludes={}, numAdditionalNodes={}, " + "clientName={}.", src, fileId, blk, Arrays.asList(existings), Arrays.asList(excludes), numAdditionalNodes, clientName); }
Attachments
Issue Links
- links to