cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/3] cxf git commit: CXF-7381 - DateFormat in MapEventLogger in the STS is not thread safe
Date Wed, 24 May 2017 09:52:06 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes eeae9d07b -> 310e52e97


CXF-7381 - DateFormat in MapEventLogger in the STS is not thread safe

# Conflicts:
#	services/sts/sts-core/src/main/java/org/apache/cxf/sts/event/map/MapEventLogger.java


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

Branch: refs/heads/3.0.x-fixes
Commit: 983f84e298c6cb20e7a5d7373fe5af1a69352705
Parents: eeae9d0
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed May 24 10:28:16 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed May 24 10:51:17 2017 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/sts/event/map/MapEventLogger.java  | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/983f84e2/services/sts/sts-core/src/main/java/org/apache/cxf/sts/event/map/MapEventLogger.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/event/map/MapEventLogger.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/event/map/MapEventLogger.java
index d54ab14..dd69e14 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/event/map/MapEventLogger.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/event/map/MapEventLogger.java
@@ -37,7 +37,7 @@ public class MapEventLogger implements MapEventListener {
     private boolean logStacktrace;
     private boolean logFieldname;
     private Level logLevel = Level.FINE;
-    private DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
+    private String format;
 
     public MapEventLogger() {
         fieldOrder.add(KEYS.TIME.name());
@@ -85,6 +85,12 @@ public class MapEventLogger implements MapEventListener {
         if (value instanceof String) {
             return (String) value;
         } else if (value instanceof Date) {
+            DateFormat dateFormat = null;
+            if (format != null) {
+                dateFormat = new SimpleDateFormat(format);
+            } else {
+                dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
+            }
             return dateFormat.format(value);
         } else {
             return (value == null) ? "<null>" : value.toString();
@@ -114,9 +120,15 @@ public class MapEventLogger implements MapEventListener {
     public void setLogFieldname(boolean logFieldname) {
         this.logFieldname = logFieldname;
     }
+<<<<<<< HEAD
     
     public void setDateFormat(String format) {
         this.dateFormat = new SimpleDateFormat(format);
+=======
+
+    public void setDateFormat(String dateFormat) {
+        this.format = dateFormat;
+>>>>>>> ee62e3c371... CXF-7381 - DateFormat in MapEventLogger in the
STS is not thread safe
     }
 
     public String getLogLevel() {


Mime
View raw message