ref #8706 reporting error time in messages
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Fri, 17 Jan 2020 14:33:19 +0000 (15:33 +0100)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Fri, 17 Jan 2020 14:33:19 +0000 (15:33 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java

index aa3058954f17f2867755ab943faab0cb75940ed4..628bf9d3ddb770701c6bb303d33202150fdebfa6 100644 (file)
@@ -2,6 +2,8 @@ package eu.etaxonomy.taxeditor.model;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -203,6 +205,12 @@ public class MessagingUtils {
         } catch (Exception e) {
             // Nothing to do
         }
+
+        // add time stamps
+        LocalDateTime date = LocalDateTime.now();
+        String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
+
+        contextInfo.add("time : " + dateTimeStr);
         contextInfo.add("login : " + login);
         contextInfo.add("editor version : " + version);
         contextInfo.add("server : " + server + " (" + name + ")" + (CdmUtils.isNotBlank(contextPath)?" / "+contextPath:""));
@@ -317,7 +325,6 @@ public class MessagingUtils {
             boolean showReason) {
 
         Throwable throwable = t;
-        StringBuffer sbStackTrace = new StringBuffer();
 
         // We need to build a MultiStatus object since the simple
         // idea of writing out the stack trace as a single string
@@ -408,12 +415,13 @@ public class MessagingUtils {
 
             @Override
             public void run() {
-                MultiStatus info = null;
+
                 String title = null;
 
                 // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
+                // FIXME is there any reason for keeping the lines below?
                 // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
-                String PID = "eu.etaxonomy.taxeditor.application";
+                // String PID = "eu.etaxonomy.taxeditor.application";
 
                 // checking security exceptions for every operation
                 RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(ex);