I have created an standalone application that is completely bundled in jar file. I would like to use log4j for logging purposes.
Is it possible to package the log4j.properties file in the jar itself, so that the PropertyConfigurator can find it at runtime? I tried putting the properties file at the root of the jar, but log4j is not able to find it there.
I havent tried this, but i think the log4j.properties file will have to be in the same folder as the jar file. However, i do think that placing the log4j.properties file in the jar should have worked. To see how log4j is trying to look for the properties file, you can try out the following: