log-files.html 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="concept"><meta name="description" content="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."><meta name="DC.Relation" scheme="URI" content="../topics/troubleshooting-overview.html"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="loghandling"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Log files</title></head><body id="loghandling"><header role="banner"><div class="header">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.0</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../topics/installing-client.html">Installing DITA-OT</a></li><li><a href="../topics/alternative-input-formats.html">Authoring formats</a></li><li><a href="../topics/building-output.html">Building output</a></li><li><a href="../parameters/index.html">Setting parameters</a></li><li><a href="../topics/extending-the-ot.html">Customizing DITA-OT</a></li><li><a href="../topics/troubleshooting-overview.html">Troubleshooting</a><ul><li class="active"><a href="../topics/log-files.html">Log files</a></li><li><a href="../topics/DITA-messages.html">DITA-OT error messages</a></li><li><a href="../topics/other-errors.html">Other error messages</a></li><li><a href="../topics/dita-command-help.html">Accessing help for the dita command</a></li><li><a href="../topics/enabling-debug-mode.html">Enabling debug mode</a></li><li><a href="../topics/increasing-the-jvm.html">Increasing Java memory</a></li><li><a href="../topics/reducing-processing-time.html">Reducing processing time</a></li></ul></li><li><a href="../reference/index.html">Reference</a></li><li><a href="../topics/dita-and-dita-ot-resources.html">Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
  7. <h1 class="title topictitle1" id="ariaid-title1">Log files</h1>
  8. <div class="body conbody"><p class="shortdesc">When you run the DITA-OT, key information is logged on the screen. This information can also be written to
  9. a log file. If you encounter a problem, you can analyze this information to determine the source of the problem and
  10. then take action to resolve it.</p>
  11. <p class="p">The logging behavior varies depending on whether you use the <span class="keyword cmdname">dita</span> command or Ant to invoke a
  12. toolkit build.</p>
  13. <dl class="dl">
  14. <dt class="dt dlterm"><span class="keyword cmdname">dita</span> command</dt>
  15. <dd class="dd">By default, only warning and error messages are written to the screen. If you use the
  16. <span class="keyword parmname">-v</span> option, logging will be more verbose and informative messages are also written out.
  17. The <span class="keyword parmname">-l</span> option can be used to write the log messages into a file.</dd>
  18. <dt class="dt dlterm">Ant</dt>
  19. <dd class="dd">By default, status information is written to the screen. If you issue the <span class="keyword parmname">-l</span> parameter,
  20. the build runs silently and the information is written to a log file with the name and location that you
  21. specified.</dd>
  22. </dl>
  23. <section class="section"><h2 class="title sectiontitle">Using other Ant loggers</h2>
  24. <p class="p">You also can use other Ant loggers; see
  25. <a class="xref" href="https://ant.apache.org/manual/listeners.html" target="_blank">Listeners &amp;
  26. Loggers</a> in the Ant documentation for more information.</p>
  27. <p class="p">For example, you can use the <strong class="ph b">AnsiColorLogger</strong> to colorize the messages written on the screen.</p>
  28. <dl class="dl">
  29. <dt class="dt dlterm"><span class="keyword cmdname">dita</span> command</dt>
  30. <dd class="dd">
  31. <p class="p">To use a custom Ant logger with the <span class="keyword cmdname">dita</span> command, add the logger to the
  32. <code class="ph codeph">ANT_ARGS</code> environment variable by calling the following command before calling the
  33. <span class="keyword cmdname">dita</span> command:</p>
  34. <pre class="pre codeblock"><code>export ANT_ARGS="-logger org.apache.tools.ant.listener.AnsiColorLogger"</code></pre>
  35. <p class="p">Now you will get colorized messages when the <span class="keyword cmdname">dita</span> command runs.</p>
  36. <div class="note tip note_tip"><span class="note__title">Tip:</span> Environment variables can also be set permanently. See
  37. <a class="xref" href="https://www.java.com/en/download/help/path.xml" target="_blank">How do I set or
  38. change the PATH system variable?</a> for information on how to set the <code class="ph codeph">PATH</code>
  39. environment variable. You can set the <code class="ph codeph">ANT_ARGS</code> environment variable in the same
  40. way.</div>
  41. </dd>
  42. <dt class="dt dlterm">Ant</dt>
  43. <dd class="dd">
  44. <p class="p">If you prefer to launch the DITA-OT directly from Ant, you can also add the logger to the
  45. <code class="ph codeph">ANT_ARGS</code> environment variable, as explained above. You can also set the logger with the
  46. <code class="ph codeph">-logger</code> parameter when calling Ant.</p>
  47. <pre class="pre codeblock"><code>ant -logger org.apache.tools.ant.listener.AnsiColorLogger</code></pre>
  48. </dd>
  49. </dl>
  50. </section>
  51. </div>
  52. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/troubleshooting-overview.html" title="This section contains information about problems that you might encounter and how to resolve them.">Error messages and troubleshooting</a></div></div></nav></article></main></body></html>