karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject karaf git commit: KARAF-5124 Fix location logging in Karaf console
Date Tue, 16 May 2017 06:13:51 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.1.x 75be64c2c -> 069cb8e9d


KARAF-5124 Fix location logging in Karaf console


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/069cb8e9
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/069cb8e9
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/069cb8e9

Branch: refs/heads/karaf-4.1.x
Commit: 069cb8e9dc9e5fd5b2b81c9e332ca5c5c494b5cb
Parents: 75be64c
Author: clockard <chris.lockard@connexta.com>
Authored: Mon May 15 14:47:21 2017 -0700
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Tue May 16 08:13:44 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/karaf/log/core/internal/KarafLogEvent.java | 3 ++-
 .../apache/karaf/log/core/internal/layout/PatternParser.java   | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/069cb8e9/log/src/main/java/org/apache/karaf/log/core/internal/KarafLogEvent.java
----------------------------------------------------------------------
diff --git a/log/src/main/java/org/apache/karaf/log/core/internal/KarafLogEvent.java b/log/src/main/java/org/apache/karaf/log/core/internal/KarafLogEvent.java
index 4cfd742..b81b281 100644
--- a/log/src/main/java/org/apache/karaf/log/core/internal/KarafLogEvent.java
+++ b/log/src/main/java/org/apache/karaf/log/core/internal/KarafLogEvent.java
@@ -46,6 +46,7 @@ public class KarafLogEvent implements PaxLoggingEvent {
         this.timeStamp = event.getTimeStamp();
         this.fQNOfLoggerClass = event.getFQNOfLoggerClass();
         this.properties = new HashMap(event.getProperties());
+        this.locationInformation = event.getLocationInformation();
     }
 
     @Override
@@ -86,7 +87,7 @@ public class KarafLogEvent implements PaxLoggingEvent {
 
     @Override
     public boolean locationInformationExists() {
-        return false;
+        return this.locationInformation != null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/069cb8e9/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternParser.java
----------------------------------------------------------------------
diff --git a/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternParser.java
b/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternParser.java
index 5e26d13..61f7343 100644
--- a/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternParser.java
+++ b/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternParser.java
@@ -451,6 +451,9 @@ public class PatternParser {
 
     public
     String convert(PaxLoggingEvent event) {
+      if(!event.locationInformationExists()){
+        return "?";
+      }
       PaxLocationInfo locationInfo = event.getLocationInformation();
       switch(type) {
       /*case FULL_LOCATION_CONVERTER:
@@ -508,6 +511,9 @@ public class PatternParser {
     }
 
     String getFullyQualifiedName(PaxLoggingEvent event) {
+      if(!event.locationInformationExists()){
+        return "?";
+      }
       return event.getLocationInformation().getClassName();
     }
   }


Mime
View raw message