aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/helper/Log.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/helper/Log.java b/src/org/traccar/helper/Log.java
index 0e7eb64e8..fa732dc9c 100644
--- a/src/org/traccar/helper/Log.java
+++ b/src/org/traccar/helper/Log.java
@@ -124,10 +124,16 @@ public final class Log {
@Override
public String format(LogRecord record) {
- StringBuilder message = new StringBuilder(record.getMessage());
+ StringBuilder message = new StringBuilder();
+
+ if (record.getMessage() != null) {
+ message.append(record.getMessage());
+ }
if (record.getThrown() != null) {
- message.append(" - ");
+ if (message.length() > 0) {
+ message.append(" - ");
+ }
if (fullStackTraces) {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);