Class ConfigureLoggerTask

  • All Implemented Interfaces:
    SubTask

    public class ConfigureLoggerTask
    extends AbstractBaseTask

    A Rhino management sub task for configuring a logger. This task is suitable for more complex configuration than the addappenderref and setloglevel tasks.

    Ant Parameters
    Attribute Description Required

    failonerror

    Flag to control failure behaviour. If 'true', the sub task will throw a BuildException when an error is encountered. If 'false', the sub task will throw a NonFatalBuildException instead of a BuildException under specific circumstances. See below for conditions (if any) which will cause a NonFatalBuildException.

    No. Default value is taken from the Rhino management parent task.

    logKey

    The name of the logger to configure.

    Yes.

    level

    Logger level.

    No.

    additivity

    Boolean value indicating logger additivity.

    No. If not specified, the default value for loggers is used.

    asynchronous

    Boolean value indicating if the logger should be asynchronous.

    No. If not specified, the default value for loggers is used.

    Nested elements

    Element

    Description

    Required

    appenderref

    The name of an appender to attach to the logger. Multiple appender references may be specified. See ConfigureLoggerTask.AppenderRef.

    No.

    component

    A plugin component of for this logger. Multiple components may be specified. See CreateGenericComponentTask.

    No.

    NonFatalBuildException throw conditions
    • This task will never throw a NonFatalBuildException. It will always fail (throw a BuildException) on errors.

    For example, to add a burst filter to an individual log key, set it to log events asynchronously, and attach it to the Cassandra appender:

    <slee-management>
        <configurelogger logKey="rhino.er"level="DEBUG"asynchronous="true">
            <appenderref name="Cassandra"/>
            <component pluginname="BurstFilter"properties="level=WARN,rate=50"/>
        </configurelogger>
    </slee-management>
    • Constructor Detail

      • ConfigureLoggerTask

        public ConfigureLoggerTask()
    • Method Detail

      • execute

        protected void execute()
                        throws org.apache.tools.ant.BuildException
        Specified by:
        execute in class AbstractBaseTask
        Throws:
        org.apache.tools.ant.BuildException
      • validateParameters

        protected void validateParameters()
                                   throws org.apache.tools.ant.BuildException
        Specified by:
        validateParameters in class AbstractBaseTask
        Throws:
        org.apache.tools.ant.BuildException
      • setLogKey

        public void setLogKey​(String logKey)
      • setLevel

        public void setLevel​(String level)
      • setAdditivity

        public void setAdditivity​(boolean additivity)
      • setAsynchronous

        public void setAsynchronous​(boolean asynchronous)