Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = null; LoggerContext loggerContext = (LoggerContext) context;
/** * This implementation checks if any of the converters in the chain handles * exceptions. If not, then this method adds a * {@link ExtendedThrowableProxyConverter} instance to the end of the chain. * <p> * This allows appenders using this layout to output exception information * event if the user forgets to add %ex to the pattern. Note that the * appenders defined in the Core package are not aware of exceptions nor * LoggingEvents. * <p> * If for some reason the user wishes to NOT print exceptions, then she can * add %nopex to the pattern. * * */ public void process(Converter<ILoggingEvent> head) { if(head == null) { // this should never happen throw new IllegalArgumentException("cannot process empty chain"); } if (!chainHandlesThrowable(head)) { Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = new ExtendedThrowableProxyConverter(); tail.setNext(exConverter); } }
/** * Add a line separator converter so that access event appears on a separate * line. */ @Override public void process(Context context, Converter<IAccessEvent> head) { if (head == null) throw new IllegalArgumentException("Empty converter chain"); // if head != null, then tail != null as well Converter<IAccessEvent> tail = ConverterUtil.findTail(head); Converter<IAccessEvent> newLineConverter = new LineSeparatorConverter(); if (!(tail instanceof LineSeparatorConverter)) { tail.setNext(newLineConverter); } } }
/** * This implementation checks if any of the converters in the chain handles * exceptions. If not, then this method adds a * {@link ExtendedThrowableProxyConverter} instance to the end of the chain. * <p> * This allows appenders using this layout to output exception information * event if the user forgets to add %ex to the pattern. Note that the * appenders defined in the Core package are not aware of exceptions nor * LoggingEvents. * <p> * If for some reason the user wishes to NOT print exceptions, then she can * add %nopex to the pattern. * * */ public void process(Converter<ILoggingEvent> head) { if(head == null) { // this should never happen throw new IllegalArgumentException("cannot process empty chain"); } if (!chainHandlesThrowable(head)) { Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = new ExtendedThrowableProxyConverter(); tail.setNext(exConverter); } }
/** * This implementation checks if any of the converters in the chain handles * exceptions. If not, then this method adds a * {@link ExtendedThrowableProxyConverter} instance to the end of the chain. * <p> * This allows appenders using this layout to output exception information * event if the user forgets to add %ex to the pattern. Note that the * appenders defined in the Core package are not aware of exceptions nor * LoggingEvents. * <p> * If for some reason the user wishes to NOT print exceptions, then she can * add %nopex to the pattern. * * */ public void process(Converter<ILoggingEvent> head) { if (!chainHandlesThrowable(head)) { Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = new ExtendedThrowableProxyConverter(); if (tail == null) { head = exConverter; } else { tail.setNext(exConverter); } } }
Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = null; LoggerContext loggerContext = (LoggerContext) context;
Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = null; LoggerContext loggerContext = (LoggerContext) context;
Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = null; LoggerContext loggerContext = (LoggerContext) context;
Converter<ILoggingEvent> tail = ConverterUtil.findTail(head); Converter<ILoggingEvent> exConverter = null; LoggerContext loggerContext = (LoggerContext) context;