@Override protected String computeConverterName(Converter c) { if (c instanceof MDCConverter) { MDCConverter mc = (MDCConverter) c; String key = mc.getFirstOption(); if (key != null) { return key; } else { return "MDC"; } } else { return super.computeConverterName(c); } } }
protected void startNewTableIfLimitReached(StringBuilder sbuf) { if (this.counter >= CoreConstants.TABLE_ROW_LIMIT) { counter = 0; sbuf.append("</table>"); sbuf.append(LINE_SEPARATOR); sbuf.append("<p></p>"); sbuf.append("<table cellspacing=\"0\">"); sbuf.append(LINE_SEPARATOR); buildHeaderRowForTable(sbuf); } }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context .getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } return effectiveMap; }
/** * Parses the pattern and creates the Converter linked list. */ @Override public void start() { int errorCount = 0; try { Parser<E> p = new Parser<E>(pattern); p.setContext(getContext()); Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); ConverterUtil.startConverters(this.head); } catch (ScanException ex) { addError("Incorrect pattern found", ex); errorCount++; } if (errorCount == 0) { super.started = true; } }
@Override public void start() { int errorCount = 0; if (throwableRenderer == null) { addError("ThrowableRender cannot be null."); errorCount++; } if (errorCount == 0) { super.start(); } }
/** * Parses the pattern and creates the Converter linked list. */ @Override public void start() { int errorCount = 0; try { Parser<E> p = new Parser<E>(pattern); p.setContext(getContext()); Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); ConverterUtil.startConverters(this.head); } catch (ScanException ex) { addError("Incorrect pattern found", ex); errorCount++; } if (errorCount == 0) { super.started = true; } }
@Override public void start() { int errorCount = 0; if (throwableRenderer == null) { addError("ThrowableRender cannot be null."); errorCount++; } if (errorCount == 0) { super.start(); } }
/** * Parses the pattern and creates the Converter linked list. */ @Override public void start() { int errorCount = 0; try { Parser<E> p = new Parser<E>(pattern); p.setContext(getContext()); Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); ConverterUtil.startConverters(this.head); } catch (ScanException ex) { addError("Incorrect pattern found", ex); errorCount++; } if (errorCount == 0) { super.started = true; } }
/** * Returns a map where the default converter map is merged with the map * contained in the context. * @return the converter map */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context .getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } return effectiveMap; }
@Override protected String computeConverterName(Converter c) { if(c instanceof MDCConverter) { MDCConverter mc = (MDCConverter) c; String key = mc.getFirstOption(); if(key != null) { return key; } else { return "MDC"; } } else { return super.computeConverterName(c); } } }
public String getPresentationHeader() { StringBuilder sbuf = new StringBuilder(); sbuf.append("<hr/>"); sbuf.append(LINE_SEPARATOR); sbuf.append("<p>Log session start time "); sbuf.append(new java.util.Date()); sbuf.append("</p><p></p>"); sbuf.append(LINE_SEPARATOR); sbuf.append(LINE_SEPARATOR); sbuf.append("<table cellspacing=\"0\">"); sbuf.append(LINE_SEPARATOR); buildHeaderRowForTable(sbuf); return sbuf.toString(); }
@Override public void start() { int errorCount = 0; if (throwableRenderer == null) { addError("ThrowableRender cannot be null."); errorCount++; } if (errorCount == 0) { super.start(); } }
/** * Parses the pattern and creates the Converter linked list. */ @Override public void start() { int errorCount = 0; try { Parser<E> p = new Parser<E>(pattern); p.setContext(getContext()); Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); ConverterUtil.startConverters(this.head); } catch (ScanException ex) { addError("Incorrect pattern found", ex); errorCount++; } if (errorCount == 0) { super.started = true; } }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context.getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } return effectiveMap; }
private void buildHeaderRowForTable(StringBuilder sbuf) { Converter c = head; String name; sbuf.append("<tr class=\"header\">"); sbuf.append(LINE_SEPARATOR); while (c != null) { name = computeConverterName(c); if (name == null) { c = c.getNext(); continue; } sbuf.append("<td class=\""); sbuf.append(computeConverterName(c)); sbuf.append("\">"); sbuf.append(computeConverterName(c)); sbuf.append("</td>"); sbuf.append(LINE_SEPARATOR); c = c.getNext(); } sbuf.append("</tr>"); sbuf.append(LINE_SEPARATOR); }
protected void startNewTableIfLimitReached(StringBuilder sbuf) { if (this.counter >= CoreConstants.TABLE_ROW_LIMIT) { counter = 0; sbuf.append("</table>"); sbuf.append(LINE_SEPARATOR); sbuf.append("<p></p>"); sbuf.append("<table cellspacing=\"0\">"); sbuf.append(LINE_SEPARATOR); buildHeaderRowForTable(sbuf); } }
@Override public void start() { int errorCount = 0; if (throwableRenderer == null) { addError("ThrowableRender cannot be null."); errorCount++; } if (errorCount == 0) { super.start(); } }
/** * Parses the pattern and creates the Converter linked list. */ @Override public void start() { int errorCount = 0; try { Parser<E> p = new Parser<E>(pattern); p.setContext(getContext()); Node t = p.parse(); this.head = p.compile(t, getEffectiveConverterMap()); ConverterUtil.startConverters(this.head); } catch (ScanException ex) { addError("Incorrect pattern found", ex); errorCount++; } if (errorCount == 0) { super.started = true; } }
/** * Returns a map where the default converter map is merged with the map * contained in the context. */ public Map<String, String> getEffectiveConverterMap() { Map<String, String> effectiveMap = new HashMap<String, String>(); // add the least specific map fist Map<String, String> defaultMap = getDefaultConverterMap(); if (defaultMap != null) { effectiveMap.putAll(defaultMap); } // contextMap is more specific than the default map Context context = getContext(); if (context != null) { @SuppressWarnings("unchecked") Map<String, String> contextMap = (Map<String, String>) context.getObject(CoreConstants.PATTERN_RULE_REGISTRY); if (contextMap != null) { effectiveMap.putAll(contextMap); } } return effectiveMap; }
@Override protected String computeConverterName(Converter<ILoggingEvent> c) { if(c instanceof MDCConverter) { MDCConverter mc = (MDCConverter) c; String key = mc.getFirstOption(); if(key != null) { return key; } else { return "MDC"; } } else { return super.computeConverterName(c); } } }