You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by tony k <to...@sbcglobal.net> on 2006/06/12 14:45:29 UTC
org.apache.log4j.pattern.PatternParser shouldn't log an ERROR for
this
in createConverter() method, if the converter doesn't have a ctor which takes
a String and a ULogger, it logs a message with ERROR severity. i think this
should be a WARNING at best, maybe just INFO. considering submitting this as
a bug, looking for other opinions:
try {
Method factory =
converterClass.getMethod(
"newInstance",
new Class[] {
Class.forName("[Ljava.lang.String;"),
org.apache.log4j.ULogger.class
});
String[] optionsArray = new String[options.size()];
optionsArray = (String[]) options.toArray(optionsArray);
Object newObj =
factory.invoke(null, new Object[] { optionsArray, logger });
if (newObj instanceof PatternConverter) {
currentLiteral.delete(
0,
currentLiteral.length()
- (converterId.length() - converterName.length()));
return (PatternConverter) newObj;
} else {
if (logger != null) {
logger.warn(
"Class " + converterClass.getName()
+ " does not extend PatternConverter.");
}
}
} catch (Exception ex) {
if (logger != null) {
logger.error("Error creating converter for " + converterId, ex);
}
--
View this message in context: http://www.nabble.com/org.apache.log4j.pattern.PatternParser-shouldn%27t-log-an-ERROR-for-this-t1773793.html#a4827930
Sent from the Log4j - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org