log-files.html 7.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 2019"><meta name="DC.rights.owner" content="(C) Copyright 2019"><meta name="DC.type" content="concept"><meta name="description" content="When you run 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.subject" content="Apache FOP, log files, command, dita, logging, Ant, debugging, Java"><meta name="keywords" content="Apache FOP, log files, command, dita, logging, Ant, debugging, Java"><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.3</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/customizing.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 DITA-OT, key information is logged on the screen. This information can also be written to a
  9. 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 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. <section class="section"><h2 class="title sectiontitle">FOP debug logging</h2>
  52. <div class="div div-index">
  53. </div>
  54. <p class="p">In PDF processing with Apache™ FOP, DITA-OT 3.1 now uses the Simple
  55. Logging Facade for Java (SLF4J), allowing for better control and formatting of FOP log messages. To reduce noise
  56. on the console, all FOP messages are set to the Info level and hidden by default.</p>
  57. <p class="p">To enable debug logging, modify the <span class="ph filepath">config/logback.xml</span> file or add your own
  58. <span class="ph filepath">logback.xml</span> to the classpath with a higher priority to override the default settings. For
  59. more information, see the
  60. <a class="xref" href="https://logback.qos.ch/manual/configuration.html" target="_blank">Logback
  61. configuration documentation</a>.</p>
  62. <div class="note attention note_attention"><span class="note__title">Attention:</span> Enabling FOP debug logging will dramatically increase the size of generated log
  63. files.</div>
  64. </section>
  65. </div>
  66. <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>