I've just started using Log4J for the first time. I created a log4j.properties file and put it in my project's folder in Eclipse. I also created a Run configuration for my application (it's just a default Run configuration, no extra options).
Now, I try running the application and I get an error message about log4j not being able to initialize itself (read the properties file). I know that the properties file must be in the classpath, so obviously the Run configuration is not setting the classpath properly.
If I go to the Classpath tab of my Run configuration, I have the following:
- Bootstrap Entries
- User Entries
- MyApplication (default classpath)
- log4j-1.2.15.jar - C:\Workspace\MyApplication\lib
However, if I add my project's folder manually (I click Add Folders, Advanced, MyApplication), log4j will be able to initialize itself.
Why is that so? Why log4j cannot find the properties file unless I add the project's folder manually? Isn't this folder in the classpath by default? (The above output would suggest that it is.)