<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
addappenderref
andsetloglevel
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 aNonFatalBuildException
instead of aBuildException
under 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 class
ConfigureLoggerTask.AppenderRef
A 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 void
addComponent(CreateGenericComponentTask component)
void
addConfiguredAppenderRef(ConfigureLoggerTask.AppenderRef ref)
protected void
execute()
void
setAdditivity(boolean additivity)
void
setAsynchronous(boolean asynchronous)
void
setLevel(String level)
void
setLogKey(String logKey)
protected void
validateParameters()
-
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:
execute
in classAbstractBaseTask
- Throws:
org.apache.tools.ant.BuildException
-
validateParameters
protected void validateParameters() throws org.apache.tools.ant.BuildException
- Specified by:
validateParameters
in 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)
-
-