private String getMessage(final String message) {
        final StringBuilder sb = new StringBuilder();
        if (message != null) {
            // We have a message so print it without new lines.
            final char[] chars = message.toCharArray();
            for (final char c : chars) {
                switch (c) {
                    case '\n':
                        sb.append(' ');
                        break;
                    case '\r':
                        break;
                    default:
                        sb.append(c);
                        break;
                }
            }
        }

        return sb.toString();
    }
@param ch     the characters from the XML document
@param start  the start position in the array
@param length the number of characters to read from the array
stroom-headless/src/main/java/stroom/headless/HeadlessFilter.java