* Load the log4j xml configuration file. If the user does not supply a
* configuration file load the sample configuration.
* @param configFile The configuration filename.
*/
private static void loadConfiguration(String configFile) {
DOMConfigurator domConfigurator = new DOMConfigurator();
if (configFile == null) {
ClassLoader loader = ClassLoader.getSystemClassLoader ();
String resourceName = "com/volantis/mcs/cli/"
+ "marinerSocketServer-log4j.xml";
try {
InputStream inputStream = loader.getResourceAsStream (resourceName);
if (inputStream != null) {
domConfigurator.doConfigure(inputStream, cat.getDefaultHierarchy());
} else {
doError("An error occured loading the default configuration");
}
}
catch (Exception e) {
doError("An error occured loading the default configuration");
}
} else {
try {
FileInputStream fis = new FileInputStream(configFile);
domConfigurator.doConfigure(fis, cat.getDefaultHierarchy());
}
catch (FileNotFoundException e) {
doError("Configuration File not found: " + configFile);
}
catch (Exception e) {