This is an automated email from the ASF dual-hosted git repository.
kwin 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 898fee0 SLING-10109 log stack trace at event listener (if available)
(#64)
898fee0 is described below
commit 898fee0ed6632a3443816ef0caefa4ce22d6066c
Author: Konrad Windszus <[email protected]>
AuthorDate: Tue Mar 23 12:13:39 2021 +0100
SLING-10109 log stack trace at event listener (if available) (#64)
---
.../distribution/journal/shared/DistributionLogEventListener.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/src/main/java/org/apache/sling/distribution/journal/shared/DistributionLogEventListener.java
b/src/main/java/org/apache/sling/distribution/journal/shared/DistributionLogEventListener.java
index 015f2c1..d2046b8 100644
---
a/src/main/java/org/apache/sling/distribution/journal/shared/DistributionLogEventListener.java
+++
b/src/main/java/org/apache/sling/distribution/journal/shared/DistributionLogEventListener.java
@@ -43,6 +43,8 @@ public class DistributionLogEventListener implements
EventHandler, Closeable {
private final ServiceRegistration<EventHandler> reg;
private final DefaultDistributionLog log;
+ private static final String MESSAGE_AND_STACKTRACE = "Message:
{},\nStacktrace: {}";
+
public DistributionLogEventListener(BundleContext context,
DefaultDistributionLog log, String pubAgentName) {
this.log = log;
this.pubAgentName = pubAgentName;
@@ -67,7 +69,7 @@ public class DistributionLogEventListener implements
EventHandler, Closeable {
if (logMessage.getStacktrace() == null) {
log.info(logMessage.getMessage());
} else {
- log.warn(logMessage.getMessage());
+ log.warn(MESSAGE_AND_STACKTRACE, logMessage.getMessage(),
logMessage.getStacktrace());
}
}