You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2021/01/31 18:37:40 UTC

[sling-org-apache-sling-distribution-journal] branch feature/log-stacktrace created (now 5c039b2)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a change to branch feature/log-stacktrace
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git.


      at 5c039b2  SLING-10109 log stack trace if available

This branch includes the following new commits:

     new 5c039b2  SLING-10109 log stack trace if available

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-distribution-journal] 01/01: SLING-10109 log stack trace if available

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/log-stacktrace
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git

commit 5c039b21544f3c874136afb128c985ab2cffb37f
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Sun Jan 31 19:37:25 2021 +0100

    SLING-10109 log stack trace if available
---
 .../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 a077df6..8127b1a 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: %s,%n Stacktrace: %s";
+    
     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());
         }
     }