link
Avalon
Javadoc Tag Specification
Home PlanetProductsCentral
Javadoc Tags
Logger Tag

The logger tag declares the name of a logging channel that is consumed by a component type. The logging tag provides management information that may be used by a container during the establishment of logging categories and targets.

Attributes
AttributeRequiredDescription
nameyes

The name of a subsidiary logging channel relative to the logging channel that is supplied to the component by the container.

Example
package org.apache.avalon.playground;

/**
 * Example of a component declaring the name of a logging channel.
 *
 * @avalon.component name="component" version="2.4"
 */
public class MyComponent extends AbstractLogEnabled
{
    private Logger m_system = null;

   /**
    * Supply of a logging channel to the component.
    * @param logger the logging channel
    * @avalon.logger name="system"
    */
    public void enableLogging( Logger logger )
    {
        super.enableLogging( logger );
        m_system = logger.getChildLogger( "system" );
    }

    ...
}

Generated meta-info type descriptor:

<type>
  <info>
    <version>2.4.0</version>
    <name>component</name>
  </info>
  <loggers>
    <logger name="system"/>
  </loggers>
</type>