1 16 17 package org.apache.log4j.xml; 18 19 import org.xml.sax.ErrorHandler ; 20 import org.xml.sax.SAXParseException ; 21 import org.apache.log4j.helpers.LogLog; 22 23 public class SAXErrorHandler implements ErrorHandler { 24 25 public 26 void error(SAXParseException ex) { 27 LogLog.error("Parsing error on line "+ex.getLineNumber()+" and column " 28 +ex.getColumnNumber()); 29 LogLog.error(ex.getMessage(), ex.getException()); 30 } 32 33 public 34 void fatalError(SAXParseException ex) { 35 error(ex); 36 } 37 38 public 39 void warning(SAXParseException ex) { 40 LogLog.warn("Parsing error on line "+ex.getLineNumber()+" and column " 41 +ex.getColumnNumber()); 42 LogLog.warn(ex.getMessage(), ex.getException()); 43 } 44 45 46 } 47 | Popular Tags |