cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6936] Make log-category for ext logging feature configurable, patch from David Karlsen applied with thanks, This closes #142
Date Wed, 08 Jun 2016 09:47:23 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 27917f3ac -> 2f56d25ec


[CXF-6936] Make log-category for ext logging feature configurable, patch from David Karlsen
applied with thanks, This closes #142


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2f56d25e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2f56d25e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2f56d25e

Branch: refs/heads/3.1.x-fixes
Commit: 2f56d25eccef5e18222b9bd96083a98871e76af9
Parents: 27917f3
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jun 8 10:46:17 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jun 8 10:46:54 2016 +0100

----------------------------------------------------------------------
 .../apache/cxf/ext/logging/slf4j/Slf4jEventSender.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2f56d25e/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
index ed22f28..db618d4 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
@@ -30,10 +30,20 @@ import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
 
 public class Slf4jEventSender implements LogEventSender {
+    private final String logCategory;
+
+    public Slf4jEventSender(String logCategory) {
+        this.logCategory = logCategory;
+    }
+
+    public Slf4jEventSender() {
+        this(null);
+    }
 
     @Override
     public void send(LogEvent event) {
-        String cat = "org.apache.cxf.services." + event.getPortTypeName().getLocalPart()
+ "." + event.getType();
+        String cat = logCategory != null ? logCategory
+            : "org.apache.cxf.services." + event.getPortTypeName().getLocalPart() + "." +
event.getType();
         Logger log = LoggerFactory.getLogger(cat);
         Set<String> keys = new HashSet<String>(); 
         try {


Mime
View raw message