<property name="fileName"value="baz"/> <slee-management> <createsyslogappender appendername="local-syslog" mdcid="mdc" host="localhost" port="9601" facility="SYSLOG" protocol='UDP"/> <createsyslogappender appendername="remote-syslog"name="RFC5424"format="RFC5424"host="logserver"port="8514"protocol="TCP"appName="MyApp"includeMDC="true"facility="LOCAL0"enterpriseNumber="18060"newLine="true"messageId="Audit"id="App"> <component pluginname="SslConfig"properties="protocol=TLS"> <component pluginname="KeyStore"properties="location=log4j2-keystore.jks, password=KEYSTORE_PASSWORD"/> <component pluginname="TrustStore"properties="location=log4j2-truststore.p12, password=TRUSTSTORE_PASSWORD, type=PKCS12"/> </component> <component pluginname="filters"> <component pluginname="ThresholdFilter"> <component pluginname="KeyValuePair"properties="key=rhino, value=WARN"/> </component> </component> </createsyslogappender> </slee-management>
Class CreateSyslogAppenderTask
- 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.CreateSyslogAppenderTask
-
- All Implemented Interfaces:
SubTask
public class CreateSyslogAppenderTask extends CreateOutputStreamAppenderTask
A Rhino management sub task for creating a log socket appender with output formatted for consumption by a syslog daemon.
Ant Parameters Attribute Type Description Required appendername
Name of the appender to create. This name must be unique.
Yes.
remotehost
Name or IP address of the remote host to connect to.
Yes.
port
Port on the remote host to connect to.
Yes.
advertise
boolean
Should the appender be advertised
No
appname
String
RFC-5424 APP-NAME to use if using the RFC-5454 record layout
No
enterprisenumber
String
The IANA enterprise number
No
facility
String
The facility to classify messages as. One of "KERN", "USER", "MAIL", "DAEMON", "AUTH", "SYSLOG", "LPR", "NEWS", "UUCP", "CRON", "AUTHPRIV", "FTP", "NTP", "AUDIT", "ALERT", "CLOCK", "LOCAL0", "LOCAL1", "LOCAL2", "LOCAL3", "LOCAL4", "LOCAL5", "LOCAL6", or "LOCAL7".
No
format
String
RFC-5424 or BSD
No
structureddataid
String
The RFC-5424 structured data ID to use if not present in the log message
No
includemdc
boolean
If true, include MDC fields in the RFC-5424 syslog record. Defaults to true.
No
mdcexcludes
String
A comma separated list of MDC fields to exclude. Mutually exclusive with mdcincludes.
No
mdcincludes
String
A comma separated list of MDC fields to include. Mutually exclusive with mdcexcludes.
No
mdcrequired
String
A comma separated list of MDC fields that must be present in the log event for it to be logged. If any of these are not present the event will be rejected with a LoggingException.
No
mdcprefix
String
A string that will be prepended to each MDC key.
No
messageid
String
The default value to be used in the MSGID field of RFC-5424 records.
No
newline
boolean
Write a newline on the end of each syslog record. Defaults to false.
No
No
protocol
String
TCP, UDP or SSL. Defaults to TCP.
No.
buffersize
Integer
The the size of the write buffer. Defults to 256kB
No.
connecttimeoutmillis
Integer
Maximum connection wait time in milliseconds if greater than 0.
No.
reconnectiondelaymillis
Integer
Maximum time to attempt reconnection for before throwing an exception. The default, 0, is to try forever.
No.
immediatefail
boolean
When set to true log events will be rejected immediately if the socket is unavailable instead of queuing.
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
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
.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. Overrides the format attribute if set. Defaults to SyslogLayout.
No.
component
Additional components such as loggerFields
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 syslog appender that sends all log messages not filtered by the loggers to Syslog on
localhost
and all WARN or greater to Syslog onlogserver
using TLS encryption.
-
-
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 CreateSyslogAppenderTask()
-
Method Summary
-
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
-
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 classCreateAppenderTask
- Throws:
org.apache.tools.ant.BuildException
-
getPluginname
public String getPluginname()
- Overrides:
getPluginname
in classCreateGenericComponentTask
-
setRemoteHost
public void setRemoteHost(String remoteHost)
-
setPort
public void setPort(Integer port)
-
setProtocol
public void setProtocol(String protocol)
-
setImmediateFail
public void setImmediateFail(Boolean immediateFail)
-
setImmediateFlush
public void setImmediateFlush(Boolean immediateFlush)
-
setReconnectionDelayMillis
public void setReconnectionDelayMillis(Integer reconnectionDelayMillis)
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(Integer connectTimeoutMillis)
-
setIgnoreExceptions
public void setIgnoreExceptions(Boolean ignoreExceptions)
- Overrides:
setIgnoreExceptions
in classCreateAppenderTask
-
addSsl
public void addSsl(CreateGenericComponentTask ssl)
-
setAdvertise
public void setAdvertise(Boolean advertise)
-
setAppName
public void setAppName(String appName)
-
setCharset
public void setCharset(String charset)
-
setEnterpriseNumber
public void setEnterpriseNumber(Integer enterpriseNumber)
-
setFacility
public void setFacility(String facility)
-
setFormat
public void setFormat(String format)
-
setId
public void setId(String id)
-
setMdcId
public void setMdcId(String mdcId)
-
setIncludeMDC
public void setIncludeMDC(Boolean includeMDC)
-
setLoggerFields
public void setLoggerFields(String loggerFields)
-
setMdcExcludes
public void setMdcExcludes(String mdcExcludes)
-
setMdcIncludes
public void setMdcIncludes(String mdcIncludes)
-
setMdcRequired
public void setMdcRequired(String mdcRequired)
-
setMdcPrefix
public void setMdcPrefix(String mdcPrefix)
-
setMessageId
public void setMessageId(String messageId)
-
setNewLine
public void setNewLine(Boolean newLine)
-
-