String lConfigFile = servlet.getInitParameter("pathToLog4JConfigFile");
FileReader fr = new FileReader(lConfigFile);
BufferedReader br = new BufferedReader(fr);
StringBuffer sbXML = new StringBuffer();
String line = "";
while ((line = br.readLine()) != null) { sbXML.append(line); }
br.close();
String xml = sbXML.toString();
InputStream isXML = new ByteArrayInputStream(xml.getBytes());
new DOMConfigurator().doConfigure(isXML, LogManager.getLoggerRepository());
Category cat = Category.getInstance(getClass().getName());
cat.info("Log4J initialized");Might not be the prettiest, but it works.
-- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com
Ye, Young wrote:
yes, you can.
-----Original Message----- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: 2005/02/16 4:48 PM To: Struts Users Mailing List Subject: log4j struts
I want to use log4j with my struts app. Can I use the struts-config.xml to specify log4j as an init parameter and point it to its external properties file? Or do i have to make my own front controller servlet for that?
thanks
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

