<slee-management>
<configurelogger logKey="rhino.er"level="DEBUG"asynchronous="true">
<appenderref name="Cassandra"/>
<component pluginname="BurstFilter"properties="level=WARN,rate=50"/>
</configurelogger>
</slee-management>
Class ConfigureLoggerTask
- java.lang.Object
-
- com.opencloud.slee.mlet.ant.tasks.AbstractBaseTask
-
- com.opencloud.slee.mlet.ant.tasks.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
addappenderrefandsetlogleveltasks.Ant Parameters Attribute Description Required failonerror
Flag to control failure behaviour. If 'true', the sub task will throw a
BuildExceptionwhen an error is encountered. If 'false', the sub task will throw aNonFatalBuildExceptioninstead of aBuildExceptionunder specific circumstances. See below for conditions (if any) which will cause aNonFatalBuildException.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 aBuildException) 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:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfigureLoggerTask.AppenderRefA nested element that identifies a reference to a logging appender.
-
Field Summary
-
Fields inherited from class com.opencloud.slee.mlet.ant.tasks.AbstractBaseTask
client, failOnError
-
-
Constructor Summary
Constructors Constructor Description ConfigureLoggerTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComponent(CreateGenericComponentTask component)voidaddConfiguredAppenderRef(ConfigureLoggerTask.AppenderRef ref)protected voidexecute()voidsetAdditivity(boolean additivity)voidsetAsynchronous(boolean asynchronous)voidsetLevel(String level)voidsetLogKey(String logKey)protected voidvalidateParameters()-
Methods inherited from class com.opencloud.slee.mlet.ant.tasks.AbstractBaseTask
getExceptionAndMessage, getFailOnError, getMessage, getOverrideFailOnError, getParent, getProject, log, run, setFailOnError
-
-
-
-
Method Detail
-
execute
protected void execute() throws org.apache.tools.ant.BuildException- Specified by:
executein classAbstractBaseTask- Throws:
org.apache.tools.ant.BuildException
-
validateParameters
protected void validateParameters() throws org.apache.tools.ant.BuildException- Specified by:
validateParametersin classAbstractBaseTask- 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)
-
addConfiguredAppenderRef
public void addConfiguredAppenderRef(ConfigureLoggerTask.AppenderRef ref)
-
addComponent
public void addComponent(CreateGenericComponentTask component)
-
-