Capturing and using the log

When a Toolkit Ant build script runs, it sends processing messages to the log. By default the messages appear only on the console.

By adding the parameter -logger org.dita.dost.log.DITAOTBuildLogger to the invocation of Ant, you can also write the messages to a disk file. You can also specify the location for the log file by setting the args.logdir Ant processing parameter.

In order to troubleshoot a build problem, it is useful to capture the Ant build output in a log file and to control the type of output Ant puts in the log. Here is an example of invoking Ant and capturing the Ant output in the file antoutput.log. The -quiet Ant command-line option is specified to eliminate non-error messages from the log.

ant -f ant\sample_xhtml.xml -quiet -l antoutput.log

The current version of the log file for each output target is placed in the document's base output directory. The prior version of the log file is replaced with each new build. Here is a set of log files for HTML Help, PDF2, and XHTML builds of this document.

Here is the beginning of the xhtml log file.