Log files

When you run the DITA-OT, key information is logged on the screen. This information can also be written to a log file. If you encounter a problem, you can analyze this information to determine the source of the problem and then take action to resolve it.

The logging behavior varies depending on whether you use the dita command or Ant to invoke a toolkit build.

dita command
By default, only warning and error messages are written to the screen. If you use the -v option, logging will be more verbose and informative messages are also written out. The -l option can be used to write the log messages into a file.
Ant
By default, status information is written to the screen. If you issue the -l parameter, the build runs silently and the information is written to a log file with the name and location that you specified.

Using other Ant loggers

You also can use other Ant loggers; see Listeners & Loggers in the Ant documentation for more information.

For example, you can use the AnsiColorLogger to colorize the messages written on the screen.

dita command

To use a custom Ant logger with the dita command, add the logger to the ANT_ARGS environment variable by calling the following command before calling the dita command:

export ANT_ARGS="-logger org.apache.tools.ant.listener.AnsiColorLogger"

Now you will get colorized messages when the dita command runs.

Tip: Environment variables can also be set permanently. See How do I set or change the PATH system variable? for information on how to set the PATH environment variable. You can set the ANT_ARGS environment variable in the same way.
Ant

If you prefer to launch the DITA-OT directly from Ant, you can also add the logger to the ANT_ARGS environment variable, as explained above. You can also set the logger with the -logger parameter when calling Ant.

ant -logger org.apache.tools.ant.listener.AnsiColorLogger