diff --git a/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java b/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java index e72a87d4000..61ca1bba230 100644 --- a/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java +++ b/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java @@ -152,7 +152,7 @@ public class Log4jWatcher extends LogWatcher { doc.setField("time", new Date(event.getTimeStamp())); doc.setField("level", event.getLevel().toString()); doc.setField("logger", event.getLogger().getName()); - doc.setField("message", event.getMessage().toString()); + doc.setField("message", event.getMessage() + ""); // avoid NPE when we have an event with null message ThrowableInformation t = event.getThrowableInformation(); if(t!=null) { doc.setField("trace", Throwables.getStackTraceAsString(t.getThrowable()));