1 22 package org.jboss.logging.layout; 23 24 import org.apache.log4j.helpers.PatternConverter; 25 import org.apache.log4j.helpers.PatternParser; 26 27 56 public class PatternParserEx extends PatternParser 57 { 58 59 public PatternParserEx(String pattern) 60 { 61 super(pattern); 62 } 63 64 protected void finalizeConverter(char c) 65 { 66 PatternConverter pc = null; 67 switch(c) 68 { 69 case 'z': 70 pc = new ThreadNDCConverter(formattingInfo); 71 currentLiteral.setLength(0); 72 break; 73 case 'Z': 74 String key = extractOption(); 75 pc = new ThreadMDCConverter(formattingInfo, key); 76 currentLiteral.setLength(0); 77 break; 78 default: 79 super.finalizeConverter(c); 80 return; 81 } 82 addConverter(pc); 83 } 84 } 85 | Popular Tags |