|
From: Dejan K. <dej...@nb...> - 2003-03-20 14:22:02
|
Babeldoc RC3 version has problem with logging. When scanner is started user will get error that log4j is not configured properly. This is happen only with scanners because scanner uses commons logging directly. Other Babeldoc code use LogService for logging. In the LogService there is static initalizer for initializing log4j. This is bad since commons-logging is used to make logging indenpendent of logging framwork used... Anyway, I tried to solve this problem but I encountered strange problems. log4j is initalized by loading log4j.properties file. This file should be in somewhere in classpath. If other file should be used for initalization then its name should be set as log4j.configuration system propery. But this simply doesn't work with Babeldoc!!!! Why? I don't have idea! If I set log4j.configuration property (in env/config.properties file) to log/config.properties it is not initalized. I tried to load this file by myself and it works. But log4j simply doesn't see this file. If I put log4j.properties file into classpath then it works fine. In log4j documentation it says that default initalizer will look for config file using log4j.configuration system property and if this property is not set it will look for log4j.properties file since it is default one. Now, if I set log4j.configuration to some value and put log4j.properties file into classpath log4j is using log4j.properties even log4j.configuration is set. This is quite strange! So until I find why log4j.configuration wont load specified file, we should use log4j.properties from the classpath. So I have renamed file log/config.properties to log4j.properties under config folder in core module. I have also removed static initalizer from LogService class. If anybody has idea what's going on please tell me! Dejan |