String log4jConf = ConfigurationManager.getProperty("dspace.dir") + File.separator + "config" + File.separator + "log4j.properties";  PropertyConfigurator.configure(log4jConf);
String log4jConfProp = ConfigurationManager.getProperty("dspace.dir") + File.separator + "config" + File.separator + "log4j.properties"; String log4jConfXml = ConfigurationManager.getProperty("dspace.dir") + File.separator + "config" + File.separator + "log4j.xml";  File xmlFile = new File(log4jConfXml); if (xmlFile.exists()) { try { DOMConfigurator.configure(xmlFile.toURL()); log.info("DSpace logging installed using log4j.xml"); } catch (MalformedURLException e) { PropertyConfigurator.configure(log4jConfProp); log.error("Logger failed to load log4j.xml, defaulted to " + "log4j.properties: " + e); } } else { PropertyConfigurator.configure(log4jConfProp); log.info("DSpace logging installed using log4j.properties"); }
    public void init()    {        // Get config parameter        String config = getServletContext().getInitParameter("dspace-config");        // Load in DSpace config        ConfigurationManager.loadConfig(config);        // Load in log4j config        String log4jConf = ConfigurationManager.getProperty("dspace.dir")                + File.separator + "config" + File.separator                + "log4j.properties";        PropertyConfigurator.configure(log4jConf);    }