A Rhino management sub task for creating a log appender writing to a file 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

Name of log file to write to.

Yes.

append

boolean

When true - the default, records will be appended to the end of the file. When set to false, the file will be cleared before new records are written.

No. If not specified, defaults to true.

bufferedio

boolean

When true - the default, records will be written to a buffer and the data will be written to disk when the buffer is full or, if immediateFlush is set, when the record is written. File locking cannot be used with bufferedIO. Performance tests have shown that using buffered I/O significantly improves performance, even if immediateFlush is enabled.

No. If not specified, defaults to true.

buffersize

int

When bufferedIO is true, this is the buffer size, the default is 8192 bytes.

No.

createondemand

boolean

The appender creates the file on-demand. The appender only creates the file when a log event passes all filters and is routed to this appender.

No. If not specified, defaults to false.

immediateflush

boolean

When set to true - the default, each write will be followed by a flush. This will guarantee the data is written to disk but could impact performance.

No. If not specified, defaults to true.

locking

boolean

When set to true, I/O operations will occur only while the file lock is held allowing FileAppenders in multiple JVMs and potentially multiple hosts to write to the same file simultaneously. This will significantly impact performance so should be used carefully. Furthermore, on many systems the file lock is "advisory" meaning that other applications can perform operations on the file without acquiring a lock.

No. If not specified, defaults to false.

ignoreexceptions

boolean

When set to true, causing exceptions encountered while appending events to be internally logged and then ignored. When set to false exceptions will be propagated to the caller, instead.

No. If not specified, defaults to true.

pattern

String

The pattern to use for logging output.

No. If not specified, the default is %m%n.

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 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.

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.

NonFatalBuildException throw conditions
  • This task will throw a NonFatalBuildException if the appender cannot be created, eg. an appender with the same name already exists.

Previous page Next page
Rhino Version 2.6.2