Rhino 2.6 supports two varieties of socket appenders, configurable format socket appenders, and syslog format. To create either use the following rhino-console commands or related MBean operations
Console command: createsocketappender
Command |
createsocketappender <appenderName> <host> <port> [-bufferedIO <true|false>] [-bufferSize size] [-connectTimeoutMillis <timeout(ms)>] [-immediateFail <true|false>] [-immediateFlush <true|false>] [-protocol <protocol>] [-reconnectionDelayMillis <delay(ms)>] [-keyStoreLocation <location>] [-keyStorePassword <password>] [-trustStoreLocation <location>] [-trustStorePassword <password>] [-ignoreExceptions <true|false>] Description The SocketAppender is an appender that writes its output to a remote destination specified by a host and port. The data can be sent over either TCP or UDP and the default format of the data is to send a Serialized LogEvent. Required Arguments appenderName The name of the Appender. host The name or address of the system that is listening for log events. port The port on the host that is listening for log events. Options -bufferedIO When true, 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. The default is true. -bufferSize The buffer size. The default is 8192 bytes. -connectTimeoutMillis The connect timeout in milliseconds. The default is 0 (infinite timeout). -immediateFail When set to true, log events will not wait to try to reconnect and will fail immediately if the socket is not available. -immediateFlush When true, each write will be followed by a flush. This will guarantee the data is written to disk but could impact performance. The default is true. -protocol 'TCP' (default), 'SSL' or 'UDP'. -reconnectionDelayMillis If set to a value greater than 0, after an error there will be an attempt to reconnect to the server after waiting the specified number of milliseconds. -keyStoreLocation The location of the keystore for SSL connections. -keyStorePassword The password of the keystore for SSL connections. -trustStoreLocation The location of the truststore for SSL connections. -trustStorePassword The password of the truststore for SSL connections. -ignoreExceptions When true, exceptions encountered while appending events will be internally logged and then ignored. The default is true. |
---|---|
Example |
$ ./rhino-console createsocketappender myappender localhost 12000 Done. |
Console command: createsyslogappender
Command |
createsyslogappender <appenderName> <host> <port> <facility> [-advertise <true|false>] [-appName <name>] [-charset <name>] [-connectTimeoutMillis <timeout(ms)>] [-enterpriseNumber <number>] [-format <name>] [-id <id>] [-immediateFail <true|false>] [-immediateFlush <true|false>] [-includeMDC <true|false>] [-mdcExcludes <key1,key2...>] [-mdcId <id>] [-mdcIncludes <key1,key2...>] [-mdcRequired <key1,key2...>] [-mdcPrefix <prefix>] [-messageId <msgid>] [-newLine <true|false>] [-reconnectionDelayMillis <delay(ms)>] [-keyStoreLocation <location>] [-keyStorePassword <password>] [-trustStoreLocation <location>] [-trustStorePassword <password>] [-ignoreExceptions <true|false>] [-protocol <protocol>] Description The SyslogAppender is a SocketAppender that writes its output to a remote destination specified by a host and port in a format that conforms with either the BSD Syslog format or the RFC 5424 format. Required Arguments appenderName The name of the Appender. host The name or address of the system that is listening for log events. port The port on the host that is listening for log events. facility The facility is used to try to classify the message. The facility option must be set to 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'. Options -advertise Indicates whether the appender should be advertised. -appName The value to use as the APP-NAME in the RFC 5424 syslog record. -charset The character set to use when converting the syslog String to a byte array. The String must be a valid Charset. If not specified, the default system Charset will be used. -connectTimeoutMillis The connect timeout in milliseconds. The default is 0 (infinite timeout). -enterpriseNumber The IANA enterprise number as described in RFC 5424 -format If set to 'RFC5424' the data will be formatted in accordance with RFC 5424. Otherwise, it will be formatted as a BSD Syslog record. -id The default structured data id to use when formatting according to RFC 5424. If the LogEvent contains a StructuredDataMessage the id from the Message will be used instead of this value. -immediateFail When set to true, log events will not wait to try to reconnect and will fail immediately if the socket is not available. -immediateFlush When true, each write will be followed by a flush. This will guarantee the data is written to disk but could impact performance. The default is true. -includeMDC Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslog record. Defaults to true. -mdcExcludes A comma separated list of mdc keys that should be excluded from the LogEvent. -mdcId The id to use for the MDC Structured Data Element. -mdcIncludes A comma separated list of mdc keys that should be included in the FlumeEvent. -mdcRequired A comma separated list of mdc keys that must be present in the MDC. -mdcPrefix A string that should be prepended to each MDC key in order to distinguish it from event attributes -messageId The default value to be used in the MSGID field of RFC 5424 syslog records. -newLine If true, a newline will be appended to the end of the syslog record. The default is false. -reconnectionDelayMillis If set to a value greater than 0, after an error there will be an attempt to reconnect to the server after waiting the specified number of milliseconds. -keyStoreLocation The location of the keystore for SSL connections. -keyStorePassword The password of the keystore for SSL connections. -trustStoreLocation The location of the truststore for SSL connections. -trustStorePassword The password of the truststore for SSL connections. -ignoreExceptions When true, exceptions encountered while appending events will be internally logged and then ignored. The default is true. -protocol 'TCP' (default), 'SSL' or 'UDP'. |
---|---|
Example |
$ ./rhino-console createsyslogappender myappender localhost 12000 USER Done. |