<?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.
-->

<document>

 <properties>
  <title>Logging</title>
 </properties>

 <body>
  <section name="Logging in the Torque generator">
    <p>
     The Torque generator uses logging to visualize the work it is doing
     at the moment. It commons-logging as logging abstraction, so in principle,
     it is logging-framework agnostic.
    </p>
    <p>
      However, the loglevel of the Torque generator can be changed by its
      configuration. This is because it is typically a hassle to configure
      the logging framework in the build tools where the torque generator
      is normally running. The ability to set the loglevel is not provided by
      commons-logging, therefore an adapter (an implementation of
      <code>org.apache.torque.generator.configuration.controller.LoggingAdapter</code>)
      is used.
    </p>
    <p>
      Natively, the Torque generator contains two implementations:
    </p>
    <ul>
      <li>
        A log4j adapter which reads and sets the current loglevel
        by reading and changing the level of log4j's root logger
        (<code>org.apache.torque.generator.configuration.controller.Log4jLoggingAdapter</code>).
      </li>
      <li>
        A dummy adapter which implements the LoggingAdapter interface
        but cannot read or change a log level
        (<code>org.apache.torque.generator.configuration.controller.DummyLoggingAdapter</code>).
      </li>
    </ul>
    <p>
      The adapter can be changed at runtime by calling the static method
      <code>setLoggingAdapter(LoggingAdapter)</code> of the class
      <code>org.apache.torque.generator.configuration.controller.Loglevel</code>.
      By default, the <code>Log4jLoggingAdapter</code> is used.
    </p>
  </section>
  
  
 </body>
</document>