<createrollingfileappender append="false"appendername="MyConferenceApender"bufferedio="true"buffersize="2048"createondemand="true"filename="${logDir}/my-conference.log"filepattern="${logDir}/my-conference-%d{MM-dd-yyyy}-%i.log.gz"ignoreexceptions="false"immediateflush="false"> <component pluginname="SizeBasedTriggeringPolicy"properties="size=1024mb"/> <component pluginname="PatternLayout"properties="pattern=%m"/> <component pluginname="DynamicThresholdFilter"properties="key=cdPty,defaultThreshold=OFF"> <component pluginname="KeyValuePair"properties="key=MyConference,value=DEBUG"/> </component> </createrollingfileappender>
Class CreateRollingFileAppenderTask
- java.lang.Object
-
- com.opencloud.slee.mlet.ant.tasks.AbstractBaseTask
-
- com.opencloud.slee.mlet.ant.tasks.CreateGenericComponentTask
-
- com.opencloud.slee.mlet.ant.tasks.CreateAppenderTask
-
- com.opencloud.slee.mlet.ant.tasks.CreateOutputStreamAppenderTask
-
- com.opencloud.slee.mlet.ant.tasks.CreateFileAppenderTask
-
- com.opencloud.slee.mlet.ant.tasks.CreateRollingFileAppenderTask
-
- All Implemented Interfaces:
SubTask
public class CreateRollingFileAppenderTask extends CreateFileAppenderTask
A Rhino management sub task for creating a log appender writing to a series of files opened in write-only mode.
Ant Parameters Attribute Type Description Required appendername
String
Name of the appender to create. This name must be unique.
Yes.
filename
String
The file to write to
Yes.
filepattern
String
The pattern of file names for archived log files. Dependent on the rollover policy used, typically contains a date pattern or %i for integer counter.
Yes.
append
boolean
Append to the file if true, otherwise clear the file on open.
No.
bufferedio
boolean
Write to an intermediate buffer to reduce the number of write() syscalls.
No.
buffersize
Integer
The the size of the write buffer. Defults to 256kB
No.
createondemand
boolean
Only create the file when data is written
No.
immediateflush
boolean
Flush to disk after every message. Reduces the risk of data loss on system crash at the cost of performance.
No.
ignoreexceptions
boolean
Log exceptions thrown by this appender then ignore them. If set to false propagate to the caller (used to support selective appenders e.g. FailoverAppender).
No.
failonerror
boolean
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.
Nested elements Element
Description
Required
filter
A filter to select events that will be reported by this appender.
No.
layout
The layout to use to format log events. If no layout is supplied the default pattern layout of "%m%n" will be used.
No.
policy
The rollover policy to determine when rollover should occur
Yes.
strategy
The strategy for archiving log files. Strategies determine the name, location, number and compression of the archived logs.
No.
NonFatalBuildException throw conditions-
This task will throw a
NonFatalBuildException
if the appender cannot be created, eg. an appender with the same name already exists.
To create a rolling file appender called MyConferenceApender with a write buffer of 2k and a file pattern of my-conference-<date>-<number>.log.gz Log messages are filtered to only include calls connecting to the MyConference system
-
-
Field Summary
-
Fields inherited from class com.opencloud.slee.mlet.ant.tasks.CreateAppenderTask
appenderName
-
Fields inherited from class com.opencloud.slee.mlet.ant.tasks.CreateGenericComponentTask
components, properties
-
Fields inherited from class com.opencloud.slee.mlet.ant.tasks.AbstractBaseTask
client, failOnError
-
-
Constructor Summary
Constructors Constructor Description CreateRollingFileAppenderTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getPluginname()
void
setFilePattern(String filePattern)
protected void
validateParameters()
-
Methods inherited from class com.opencloud.slee.mlet.ant.tasks.CreateFileAppenderTask
setAppend, setBufferedIO, setBufferSize, setCreateOnDemand, setFileName, setLocking
-
Methods inherited from class com.opencloud.slee.mlet.ant.tasks.CreateOutputStreamAppenderTask
setImmediateFlush
-
Methods inherited from class com.opencloud.slee.mlet.ant.tasks.CreateAppenderTask
execute, setAppenderName, setIgnoreExceptions
-
Methods inherited from class com.opencloud.slee.mlet.ant.tasks.CreateGenericComponentTask
addComponent, addPropertyNotNull, addPropertySet, allTrue, buildGenericComponentData, expandPropertySets, getComponents, getPropertiesArray, setPluginname, setProperties, validateHasProperty
-
Methods inherited from class com.opencloud.slee.mlet.ant.tasks.AbstractBaseTask
getExceptionAndMessage, getFailOnError, getMessage, getOverrideFailOnError, getParent, getProject, log, run, setFailOnError
-
-
-
-
Method Detail
-
validateParameters
protected void validateParameters() throws org.apache.tools.ant.BuildException
- Overrides:
validateParameters
in classCreateFileAppenderTask
- Throws:
org.apache.tools.ant.BuildException
-
getPluginname
public String getPluginname()
- Overrides:
getPluginname
in classCreateFileAppenderTask
-
setFilePattern
public void setFilePattern(String filePattern)
-
-