Skip to content

Commit

Permalink
Merge pull request #208 in MC/connect from bugfix/ROCKSOLID-3417-serv…
Browse files Browse the repository at this point in the history
…er-fails-to-startup-if-root-logger-level-is-debug to 3.6.x

* commit 'daee4a00d205e122a93b4ce9abf655e3d797c2ae':
  Fixing issue causing the server to throw NPE on startup if log level is DEBUG.
  • Loading branch information
Peter Ladesma authored and Peter Ladesma committed Nov 12, 2018
2 parents 9cb5fed + daee4a0 commit 647edd3
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static com.mirth.connect.plugins.serverlog.ServerLogServletInterface.PERMISSION_VIEW;
import static com.mirth.connect.plugins.serverlog.ServerLogServletInterface.PLUGIN_POINT;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
Expand Down Expand Up @@ -54,12 +55,18 @@ public void init(Properties properties) {
}

public synchronized void newServerLogReceived(String level, Date date, String threadName, String category, String lineNumber, String message, String throwableInformation) {
logController.addLogItem(new ServerLogItem(serverId, logId, level, date, threadName, category, lineNumber, message, throwableInformation));
logId++;
if (logController != null) {
logController.addLogItem(new ServerLogItem(serverId, logId, level, date, threadName, category, lineNumber, message, throwableInformation));
logId++;
}
}

public List<ServerLogItem> getServerLogs(int fetchSize, Long lastLogId) {
return logController.getServerLogs(fetchSize, lastLogId);
if (logController != null) {
return logController.getServerLogs(fetchSize, lastLogId);
} else {
return new ArrayList<ServerLogItem>();
}
}

@Override
Expand Down

0 comments on commit 647edd3

Please sign in to comment.