I've been getting the following error when I run SQLUnit using the sqlunit-4.9.jar that is pre-built with the 4.9 distribution:
[sqlunit] WARN [main] (SQLUnit.java:168) - log4j.properties not found (using defaults)
I'm a regular user of Ant and Log4j but a recent SQLUnit convert. After seeing that log4j warning for a few days, I finally decided to resolve the issue.
I copied my log4j.properties file to my project home directory (alongside my build.xml and build.properties files). Still got the error.
Then copied the log4j.properties file to every subdir under the project home. Same results.
Eventually I copied the log4j.properties file into the sqlunit-4.9.jar itself, in the root directory of the archive, along with sqlunit.dtd and META-INF and net subdirectories. This finally resolved the problem and I have not seen the warning since.
But this is not ideal, obviously. I'd prefer to have an external log4j.properties file so I can have one copy of the sqlunit-4.9.jar file in my classpath and then various properties files in the different project directories.
I'm sure I'm not the only one. Consider this a bug report. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been rethinking this entire logging deal for version 5.0 to remove the internal dependency (the using defaults thing) on log4j.
However, you should be able to put it anywhere in your classpath for it to be visible. I have my local copy in my project root and have . (cwd) in my definition for system.class.path and it works for me. I think that putting it in the root of the jar works for you because your classpath points to sqlunit.jar and this includes it.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been getting the following error when I run SQLUnit using the sqlunit-4.9.jar that is pre-built with the 4.9 distribution:
[sqlunit] WARN [main] (SQLUnit.java:168) - log4j.properties not found (using defaults)
I'm a regular user of Ant and Log4j but a recent SQLUnit convert. After seeing that log4j warning for a few days, I finally decided to resolve the issue.
I copied my log4j.properties file to my project home directory (alongside my build.xml and build.properties files). Still got the error.
Then copied the log4j.properties file to every subdir under the project home. Same results.
Eventually I copied the log4j.properties file into the sqlunit-4.9.jar itself, in the root directory of the archive, along with sqlunit.dtd and META-INF and net subdirectories. This finally resolved the problem and I have not seen the warning since.
But this is not ideal, obviously. I'd prefer to have an external log4j.properties file so I can have one copy of the sqlunit-4.9.jar file in my classpath and then various properties files in the different project directories.
I'm sure I'm not the only one. Consider this a bug report. :)
Hi Wayne,
I have been rethinking this entire logging deal for version 5.0 to remove the internal dependency (the using defaults thing) on log4j.
However, you should be able to put it anywhere in your classpath for it to be visible. I have my local copy in my project root and have . (cwd) in my definition for system.class.path and it works for me. I think that putting it in the root of the jar works for you because your classpath points to sqlunit.jar and this includes it.
-sujit