diff --git a/doc/GATK_User_Manual.pdf b/doc/GATK_User_Manual.pdf index 8ce3c0f2d..8eae0ebbc 100644 Binary files a/doc/GATK_User_Manual.pdf and b/doc/GATK_User_Manual.pdf differ diff --git a/doc/GATK_User_Manual.tex b/doc/GATK_User_Manual.tex index 44c2e22f8..d6a567076 100755 --- a/doc/GATK_User_Manual.tex +++ b/doc/GATK_User_Manual.tex @@ -102,4 +102,20 @@ Users can write to these streams just as they write to System.out and System.err. This output can be redirected to a file using the out, err, and outerr command-line arguments. +\subsection{Logging} +The walkers provide a protected logger instance. Users can adjust the +debug level of the walkers using the -l command line option. + +Turning on verbose logging can produce more output than the user +really needs. To selectively turn on logging for a class or package, +the user can specify a log4j.properties property file from the command +line as follows: + +\begin{verbatim} +-Dlog4j.configuration=file:///humgen/gsa-scr1/hanna/src/Sting/java/config/log4j.properties +\end{verbatim} + +An example log4j.properties file is available in the java/config +directory of the subversion repository. + \end{document} diff --git a/java/config/log4j.properties b/java/config/log4j.properties new file mode 100644 index 000000000..26e6a018c --- /dev/null +++ b/java/config/log4j.properties @@ -0,0 +1,10 @@ +log4j.logger.org.broadinstitute.sting.gatk.walkers.Walker=INFO, walker + +# use this to append walker data to the console only +log4j.appender.walker=org.apache.log4j.ConsoleAppender + +# uncomment the following instead for writing debug info to a file called walker.log +#log4j.appender.walker=org.apache.log4j.FileAppender +#log4j.appender.walker.File=walker.log +#log4j.appender.walker.layout=org.apache.log4j.PatternLayout +#log4j.appender.walker.layout.ConversionPattern=%r [%t] %-5p %c - %m%n diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/Walker.java b/java/src/org/broadinstitute/sting/gatk/walkers/Walker.java index 461970c00..b5ee85c7e 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/Walker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/Walker.java @@ -8,6 +8,7 @@ import java.util.List; import org.broadinstitute.sting.gatk.GenomeAnalysisTK; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.Pair; +import org.apache.log4j.Logger; /** * Created by IntelliJ IDEA. @@ -19,6 +20,8 @@ import org.broadinstitute.sting.utils.Pair; public abstract class Walker { // TODO: Can a walker be templatized so that map and reduce live here? + protected static Logger logger = Logger.getLogger(Walker.class); + /** * A stream for writing normal (non-error) output. System.out by default. */