<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
  <header>
    <title>Java Logging API</title>
  </header>
  <body>
    <p>
      The Java Logging API is part the
      <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/package-summary.html">J2SE
      API Specification</a> an overview of the key elements of this API is
      <a href="http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html">available</a>.
    </p>
    <section>
      <title>Integrating Java Logs in a Forrest Site</title>
      <p>
        If you have the log file available, simply place it in your projects
        xdoc directory and link to it as normal. For example, the following file
        is stored within this projects xdocs directory in a <code>samples</code>
        subfolder.
      </p>
      <source>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<log>
<record>
  <date>2000-08-23 19:21:05</date>
  <millis>967083665789</millis>
  <sequence>1256</sequence>
  <logger>kgh.test.fred</logger>
  <level>INFO</level>
  <class>kgh.test.XMLTest</class>
  <method>writeLog</method>
  <thread>10</thread>
  <message>Hello world!</message>
</record>
<record>
  <date>2000-08-23 19:21:10</date>
  <millis>967083665789</millis>
  <sequence>1265</sequence>
  <logger>kgh.test.fred</logger>
  <level>INFO</level>
  <class>kgh.test.XMLTest</class>
  <method>writeLog</method>
  <thread>10</thread>
  <message>I'm the third log message (but recorded second in the file)</message>
</record>
<record>
  <date>2000-08-23 19:21:06</date>
  <millis>967083665789</millis>
  <sequence>1260</sequence>
  <logger>kgh.test.fred</logger>
  <level>INFO</level>
  <class>kgh.test.XMLTest</class>
  <method>writeLog</method>
  <thread>10</thread>
  <message>This is the second log message in terms of time, but the third in the log file.</message>
</record>
<record>
  <date>2000-08-23 19:21:15</date>
  <millis>967083665789</millis>
  <sequence>1270</sequence>
  <logger>kgh.test.fred</logger>
  <level>INFO</level>
  <class>kgh.test.XMLTest</class>
  <method>destroy</method>
  <thread>10</thread>
  <message>Goodbye world!</message>
</record>
</log>
      ]]>
      </source>
      <p>
        To view this document as an HTML page you would use the following link
        <a href="samples/javaLogAPI.html">&lt;a
        href="samples/javaLogAPI.html&gt;</a>.
      </p>
      <p>
        If the log file is not available to you, but instead is available at a
        given URL then you need to tell the plugin where to find the log file,
        it will then retrieve the file and include it as if it were local. To do
        this you make a request the URL <code>/do/view/log.FORMAT</code>, where
        <code>FORMAT</code> is any extension that your Forrest project
        recognises (e.g. html, pdf etc). In addition you need to pass some
        parameters in the URL so that the plugin can find your log file:
      </p>
      <table>
        <tr>
          <th>Parameter</th>
          <th>Description</th>
        </tr>
        <tr>
          <td>location</td>
          <td>The location of the log file</td>
        </tr>
        <tr>
          <td>protocol</td>
          <td>The protocol to use when retrieving the log file</td>
        </tr>
      </table>
      <p>
        For example, to retrieve a log file from a location on your local hard
        drive you would construct an URL something like this (to view the html
        page):
      </p>
      <source>
        &lt;a href="/do/view/log.html?protocol=file&amp;location=path\to\file\file.log"&gt;View Log&lt;/&gt;
      </source>
      <p>
        or to view the PDF version of the log file:
      </p>
      <source>
        &lt;a href="/do/view/log.pdf?protocol=file&amp;location=path\to\file\file.log"&gt;View Log&lt;/&gt;
      </source>
    </section>
  </body>
</document>
