diff --git a/README.md b/README.md index cf0654d..43f34c7 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,16 @@ Development Installation ./gradlew tasks +Configuring Logging +=================== + +Logging is provided using the logback library. The `logback.xml` file in `src/dist/lib/config/` provides a default configuration for the command line tool. +In release and snapshot artifacts, `logback.xml` is in `lib/config/`. +You can configure logging by editing the provided `logback.xml` or by specifying the path to a different file:: + +JAVA_OPTS="-Dlogback.configurationFile=/path/to/external/logback.xml" \ + bioformats2raw ... + Eclipse Configuration ===================== @@ -42,6 +52,8 @@ Eclipse Configuration ./gradlew eclipse +2. Add the logback configuration in `src/dist/lib/config/` to your CLASSPATH. + Usage ===== diff --git a/build.gradle b/build.gradle index 9328419..07693e3 100644 --- a/build.gradle +++ b/build.gradle @@ -74,6 +74,18 @@ distributions { } } +startScripts { + // placing logback.xml somewhere under src/dist/lib/ keeps it out of + // raw2ometiff-*.jar but automatically includes it in the distribution zip + // the directory containing logback.xml must be explicitly added to the + // startup scripts' classpath, otherwise it will not be detected + + // a subdirectory of 'src/dist/lib/' (not just 'src/dist/') is necessary, + // likely due to https://issues.gradle.org/browse/GRADLE-2991 + // see also discussion in https://github.com/glencoesoftware/bioformats2raw/pull/169 + classpath += files('src/dist/lib/config/') +} + publishing { publications { raw2ometiff(MavenPublication) { diff --git a/src/main/resources/logback.xml b/src/dist/lib/config/logback.xml similarity index 100% rename from src/main/resources/logback.xml rename to src/dist/lib/config/logback.xml