I’m using the Apache Derby embedded database for unit testing in a Maven project. Unfortunately whenever I run the test I end up with the derby.log file in the root of the project. The database itself is created in the target directory (jdbc:derby:target/unittest-db;create=true) so that is not a problem. After consulting the reference guide I tried setting the logDevice parameter on the JDBC url (jdbc:derby:target/unittest-db;create=true;logDevice=/mylogs) but that seems to be for a different log, hence derby.log still appears.
Any help is much appreciated.
You can get rid of
derby.logfile by creating the following classand setting the JVM system property
derby.stream.error.field, for example, using the following JVM command-line argument:Credit to whom it is due.