Class CocoonTargetFactory

  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
          extended by org.apache.avalon.excalibur.logger.factory.FileTargetFactory
              extended by org.apache.cocoon.util.log.CocoonTargetFactory
All Implemented Interfaces:
LogTargetFactory, Configurable, Contextualizable, LogEnabled

Deprecated. This class will be removed in 2.2

public class CocoonTargetFactory
extends FileTargetFactory

CocoonTargetFactory class. This factory is able to create different LogTargets specific to Cocoon according to the following configuration syntax:

 <file id="foo">
  <format type="raw|pattern|extended|xml|cocoon">pattern to be used if needed</format>
  <rotation type="revolving|unique" init="5" max="10">

Some explanations about the Elements used in the configuration:

This denotes the name of the file to log to. It can be constructed out of entries in the passed Context object as ${context-key}. This element is required.
The type attribute of the pattern element denotes the type of Formatter to be used and according to it the pattern to use for. This elements defaults to:

%7.7{priority} %{time} [%8.8{category}] (%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}

If the log file should be deleted every time the logger is creates (normally at the start of the applcation) or not and thus the log entries will be appended. This elements defaults to false.
This is an optional element. The type attribute determines which FileStrategy to user (revolving=RevolvingFileStrategy, unique=UniqueFileStrategy). The required init and max attribute are used to determine the initial and maximum rotation to use on a type="revolving" attribute.
uses the OrRotateStrategy to combine the children
The number of bytes if no suffix used or kilo bytes (1024) if suffixed with 'k' or mega bytes (1024k) if suffixed with 'm' when a file rotation should occur. It doesn't make sense to specify more than one.
The time as HH:MM:SS when a rotation should occur. If you like to rotate a logfile more than once a day put an <or> element immediately after the <rotation> element and specify the times (and one size, too) inside the <or> element.

CVS $Id: CocoonTargetFactory.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Giacomo Pati

Field Summary
Fields inherited from class org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
m_configuration, m_context
Constructor Summary
Method Summary
protected  Formatter getFormatter(Configuration conf)
Methods inherited from class org.apache.avalon.excalibur.logger.factory.FileTargetFactory
createTarget, createTarget, getFilename, getFileStrategy, getRotateStrategy
Methods inherited from class org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
configure, contextualize
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CocoonTargetFactory()
Method Detail


protected Formatter getFormatter(Configuration conf)
getFormatter in class FileTargetFactory

Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.