try
{
docFactory.setValidating(true);
docBuilder = docFactory.newDocumentBuilder();
docBuilder.setErrorHandler(errHandler);
docBuilder.setEntityResolver(new Log4jEntityResolver());
doc = docBuilder.parse(fileName);
}
catch (ParserConfigurationException e)
{
LOGGER.warn("Unable to parse the log4j XML file due to possible configuration error: ", e);