The easiest way would be to write your own Layout that delegates to encapsulated layouts (possibly instances of PatternLayout or EnhancedPatternLayout) depending on the level. Log parsing tools would likely be baffled by formats that change every logging event, so you might want to design your patterns so they are layout similarly. For example, you might add a literal "(?:?)" into the INFO pattern where "(%F:%L)" appears in the ERROR record.
On Jan 10, 2011, at 2:53 AM, ysbn wrote: > Hi, I'm using ConsoleAppender and I want to set different "ConversionPattern" > for each Priority level. > For example: INFO records will use pattern: %d %5p - %m%n > and ERROR records will use pattern: %d %5p (%F:%L) - %m%n > How can this be done? > Thanks! > View this message in context: ConversionPattern per Priority (ConsoleAppender) > Sent from the Log4j - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
