|
|
@@ -102,31 +102,35 @@ public abstract class CommEngine extends HttpServlet |
|
|
ServletContext servletContext = getServletContext(); |
|
|
ServletContext servletContext = getServletContext(); |
|
|
String propertiesFilePath; |
|
|
String propertiesFilePath; |
|
|
|
|
|
|
|
|
propertiesFilePath = servletContext.getInitParameter(getPropertiesContextName()); |
|
|
|
|
|
File propertiesFile = new File(propertiesFilePath); |
|
|
|
|
|
|
|
|
|
|
|
// Configure log4j using log4j.properties file, \ |
|
|
|
|
|
// sibling to the engine properties file. |
|
|
|
|
|
// This change is backward compatible with placing the log4j.properties file in |
|
|
|
|
|
// the class path. |
|
|
|
|
|
String log4j_properties = propertiesFile.getParent() + "/log4j.properties"; |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
PropertyConfigurator.configure(log4j_properties); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception e) |
|
|
|
|
|
{ |
|
|
|
|
|
// Do nothing, assuming the exception is FileNotFoundException. |
|
|
|
|
|
// Remaining log4j initialization will look for log4j.properties |
|
|
|
|
|
// file in the class path. |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// propertiesFilePath = servletContext.getInitParameter(getPropertiesContextName()); |
|
|
|
|
|
// File propertiesFile = new File(propertiesFilePath); |
|
|
|
|
|
// |
|
|
|
|
|
// // Configure log4j using log4j.properties file, \ |
|
|
|
|
|
// // sibling to the engine properties file. |
|
|
|
|
|
// // This change is backward compatible with placing the log4j.properties file in |
|
|
|
|
|
// // the class path. |
|
|
|
|
|
// String log4j_properties = propertiesFile.getParent() + "/log4j.properties"; |
|
|
|
|
|
// try |
|
|
|
|
|
// { |
|
|
|
|
|
// PropertyConfigurator.configure(log4j_properties); |
|
|
|
|
|
// } |
|
|
|
|
|
// catch (Exception e) |
|
|
|
|
|
// { |
|
|
|
|
|
// // Do nothing, assuming the exception is FileNotFoundException. |
|
|
|
|
|
// // Remaining log4j initialization will look for log4j.properties |
|
|
|
|
|
// // file in the class path. |
|
|
|
|
|
// } |
|
|
// This activates Logger class instantiation. At this point, if lo4j |
|
|
// This activates Logger class instantiation. At this point, if lo4j |
|
|
// is not yet configured, |
|
|
// is not yet configured, |
|
|
// it will look for the log4j.properties file in the class path. |
|
|
// it will look for the log4j.properties file in the class path. |
|
|
myLogger = Logger.getLogger(CommEngine.class); |
|
|
myLogger = Logger.getLogger(CommEngine.class); |
|
|
|
|
|
|
|
|
myLogger.info("init() invoked"); |
|
|
myLogger.info("init() invoked"); |
|
|
CommonLogger.startup.info("Using lo4j properites file " + log4j_properties); |
|
|
|
|
|
|
|
|
File propertiesFile = new File( |
|
|
|
|
|
getClass().getClassLoader().getResource("properties").getFile() |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// CommonLogger.startup.info("Using lo4j properites file " + log4j_properties); |
|
|
CommonLogger.startup.info("Using configuration file " + propertiesFile.getAbsolutePath()); |
|
|
CommonLogger.startup.info("Using configuration file " + propertiesFile.getAbsolutePath()); |
|
|
config = new Properties(); |
|
|
config = new Properties(); |
|
|
try |
|
|
try |
|
|
|