private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) { buf.append("<td class=\""); buf.append(computeConverterName(c)); buf.append("\">"); buf.append(Transform.escapeTags(c.convert(event))); buf.append("</td>"); buf.append(LINE_SEPARATOR); }
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) { int commonFrames = tp.getCommonFrames(); if (commonFrames > 0) { sb.append("<br />").append(CoreConstants.CAUSED_BY); } sb.append(tp.getClassName()).append(": ").append(Transform.escapeTags(tp.getMessage())); sb.append(CoreConstants.LINE_SEPARATOR); }
void render(StringBuilder sbuf, IThrowableProxy tp) { printFirstLine(sbuf, tp); int commonFrames = tp.getCommonFrames(); StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray(); for (int i = 0; i < stepArray.length - commonFrames; i++) { StackTraceElementProxy step = stepArray[i]; sbuf.append(TRACE_PREFIX); sbuf.append(Transform.escapeTags(step.toString())); sbuf.append(CoreConstants.LINE_SEPARATOR); } if (commonFrames > 0) { sbuf.append(TRACE_PREFIX); sbuf.append("\t... ").append(commonFrames).append(" common frames omitted").append(CoreConstants.LINE_SEPARATOR); } }
buf.append(Transform.escapeTags(event.getLoggerName())); buf.append("\"\r\n"); buf.append(" timestamp=\""); buf.append(event.getLevel()); buf.append("\" thread=\""); buf.append(Transform.escapeTags(event.getThreadName())); buf.append("\">\r\n"); buf.append(Transform.escapeTags(event.getFormattedMessage())); buf.append("</log4j:message>\r\n"); buf.append("\"\r\n"); buf.append(" method=\""); buf.append(Transform.escapeTags(immediateCallerData.getMethodName())); buf.append("\" file=\""); buf.append(Transform.escapeTags(immediateCallerData.getFileName())); buf.append("\" line=\""); buf.append(immediateCallerData.getLineNumber()); for (Entry<String, String> entry : entrySet) { buf.append("\r\n <log4j:data"); buf.append(" name='" + Transform.escapeTags(entry.getKey()) + "'"); buf.append(" value='" + Transform.escapeTags(entry.getValue()) + "'"); buf.append(" />");
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
/** * This method takes a string which may contain HTML tags (ie, <b>, * <table>, etc) and replaces any '<' and '>' characters with * respective predefined entity references. * * @param input * The text to be converted. */ public static String escapeTags(final String input) { // if input is null or zero length or contains no < and > characters, return it as is if ((input == null) || (input.length() == 0) || (input.indexOf("<") == -1 && input.indexOf(">") == -1)) { return input; } StringBuffer buf = new StringBuffer(input); return escapeTags(buf); }
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) { int commonFrames = tp.getCommonFrames(); if (commonFrames > 0) { sb.append("<br />").append(CoreConstants.CAUSED_BY); } sb.append(tp.getClassName()).append(": ").append( Transform.escapeTags(tp.getMessage())); sb.append(CoreConstants.LINE_SEPARATOR); }
void render(StringBuilder sbuf, IThrowableProxy tp) { printFirstLine(sbuf, tp); int commonFrames = tp.getCommonFrames(); StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray(); for (int i = 0; i < stepArray.length - commonFrames; i++) { StackTraceElementProxy step = stepArray[i]; sbuf.append(TRACE_PREFIX); sbuf.append(Transform.escapeTags(step.toString())); sbuf.append(CoreConstants.LINE_SEPARATOR); } if (commonFrames > 0) { sbuf.append(TRACE_PREFIX); sbuf.append("\t... ").append(commonFrames).append(" common frames omitted") .append(CoreConstants.LINE_SEPARATOR); } }
buf.append("\"\r\n"); buf.append(" method=\""); buf.append(Transform.escapeTags(immediateCallerData.getMethodName())); buf.append("\" file=\""); buf.append(immediateCallerData.getFileName()); for (Entry<String, String> entry : entrySet) { buf.append("\r\n <log4j:data"); buf.append(" name='" + Transform.escapeTags(entry.getKey()) + "'"); buf.append(" value='" + Transform.escapeTags(entry.getValue()) + "'"); buf.append(" />");
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
private void printThrowable(StringBuilder buf, Throwable t) { buf.append(" <tr>\r\n"); buf.append(" <td colspan=\"4\" class=\"exception\"><pre>"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); buf.append(Transform.escapeTags(sw.getBuffer())); buf.append(" </pre></td>\r\n"); buf.append(" </tr>\r\n"); } }
private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) { buf.append("<td class=\""); buf.append(computeConverterName(c)); buf.append("\">"); buf.append(Transform.escapeTags(c.convert(event))); buf.append("</td>"); buf.append(LINE_SEPARATOR); }
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) { int commonFrames = tp.getCommonFrames(); if (commonFrames > 0) { sb.append("<br />").append(CoreConstants.CAUSED_BY); } sb.append(tp.getClassName()).append(": ").append( Transform.escapeTags(tp.getMessage())); sb.append(CoreConstants.LINE_SEPARATOR); }
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) { int commonFrames = tp.getCommonFrames(); if (commonFrames > 0) { sb.append("<br />").append(CoreConstants.CAUSED_BY); } sb.append(tp.getClassName()).append(": ").append( Transform.escapeTags(tp.getMessage())); sb.append(CoreConstants.LINE_SEPARATOR); }
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) { int commonFrames = tp.getCommonFrames(); if (commonFrames > 0) { sb.append("<br />").append(CoreConstants.CAUSED_BY); } sb.append(tp.getClassName()).append(": ").append(Transform.escapeTags(tp.getMessage())); sb.append(CoreConstants.LINE_SEPARATOR); }
public void printFirstLine(StringBuilder sb, IThrowableProxy tp) { int commonFrames = tp.getCommonFrames(); if (commonFrames > 0) { sb.append("<br />").append(CoreConstants.CAUSED_BY); } sb.append(tp.getClassName()).append(": ").append( Transform.escapeTags(tp.getMessage())); sb.append(CoreConstants.LINE_SEPARATOR); }