This is an automated email from the ASF dual-hosted git repository.
tmaret pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git
The following commit(s) were added to refs/heads/master by this push:
new 4dfccd8 SLING-10227: Improvement in distribution logging to log id
generated … (#68)
4dfccd8 is described below
commit 4dfccd88eb555a4a5cc36afbc6d5a55ce909028d
Author: Amit Jain <[email protected]>
AuthorDate: Tue Mar 23 14:25:37 2021 +0530
SLING-10227: Improvement in distribution logging to log id generated … (#68)
* SLING-10227: Improvement in distribution logging to log id generated for
binary reference and not log reference
- Log the binary reference id separately which can be matched with the
package id and should not be removed
- Remove logging the binaryRef prop as it may leak secrets from
implementations
Co-authored-by: amjain <[email protected]>
---
.../journal/impl/publisher/PackageMessageFactory.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageMessageFactory.java
b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageMessageFactory.java
index 230ee6f..6898e90 100644
---
a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageMessageFactory.java
+++
b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageMessageFactory.java
@@ -111,10 +111,8 @@ public class PackageMessageFactory {
.pkgType(packageBuilder.getType());
String storeRef;
- String id;
try {
- id = UUID.randomUUID().toString();
- storeRef = binaryStore.put(id, disPkg.createInputStream(),
pkgLength);
+ storeRef = binaryStore.put(pkgId, disPkg.createInputStream(),
pkgLength);
} catch (IOException e) {
throw new DistributionException(e.getMessage(), e);
}
@@ -125,7 +123,9 @@ public class PackageMessageFactory {
pkgBuilder.pkgBinary(pkgBinary);
}
PackageMessage pipePackage = pkgBuilder.build();
- LOG.debug("Created distribution package {} with binary id={}",
pipePackage, id);
+
+ LOG.info("Created distribution package [{}] with length [{}]", pkgId,
pkgLength);
+
disPkg.delete();
return pipePackage;
}