org.productivity.java.syslog4j.impl.log4j
Class Syslog4jAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.productivity.java.syslog4j.impl.log4j.Syslog4jAppenderSkeleton
          extended by org.productivity.java.syslog4j.impl.log4j.Syslog4jAppender
All Implemented Interfaces:
java.io.Serializable, org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler, SyslogConstants

public class Syslog4jAppender
extends Syslog4jAppenderSkeleton

Syslog4jAppender provides a Log4j Appender wrapper for Syslog4j.

Note: Syslog4jAppender does NOT extend Log4j's SyslogAppender.

Example log4j.xml configuration:

 
   <appender name="Syslog4j" class="org.productivity.java.syslog4j.impl.log4j.Syslog4jAppender">
                <param name="Facility" value="user"/>
                <param name="Protocol" value="tcp"/>
                <param name="Host" value="192.168.0.1"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m"/>
                </layout>
   </appender>
 
 

All available parameters are:

Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the LGPL license is available in the META-INF folder in all distributions of Syslog4j and in the base directory of the "doc" ZIP.

Version:
$Id: Syslog4jAppender.java,v 1.2 2011/01/23 20:49:12 cvs Exp $
Author:
<syslog4j@productivity.org>
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.productivity.java.syslog4j.impl.log4j.Syslog4jAppenderSkeleton
charSet, facility, host, ident, initialized, localName, maxMessageLength, maxShutdownWait, port, protocol, splitMessageBeginText, splitMessageEndText, syslog, threaded, threadLoopInterval, truncateMessage, useStructuredData, writeRetries
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Fields inherited from interface org.productivity.java.syslog4j.SyslogConstants
AF_UNIX, CACHE_HOST_ADDRESS_DEFAULT, CHAR_SET_DEFAULT, CRLF, FACILITY_AUTH, FACILITY_AUTHPRIV, FACILITY_CRON, FACILITY_DAEMON, FACILITY_FTP, FACILITY_KERN, FACILITY_LOCAL0, FACILITY_LOCAL1, FACILITY_LOCAL2, FACILITY_LOCAL3, FACILITY_LOCAL4, FACILITY_LOCAL5, FACILITY_LOCAL6, FACILITY_LOCAL7, FACILITY_LPR, FACILITY_MAIL, FACILITY_NEWS, FACILITY_SYSLOG, FACILITY_USER, FACILITY_UUCP, IDENT_SUFFIX_DEFAULT, INCLUDE_IDENT_IN_MESSAGE_MODIFIER_DEFAULT, JNA_NATIVE_CLASS, LEVEL_ALERT, LEVEL_CRITICAL, LEVEL_DEBUG, LEVEL_EMERGENCY, LEVEL_ERROR, LEVEL_INFO, LEVEL_NOTICE, LEVEL_WARN, LF, MAX_MESSAGE_LENGTH_DEFAULT, MAX_QUEUE_SIZE_DEFAULT, MAX_SHUTDOWN_WAIT_DEFAULT, OPTION_LOG_CONS, OPTION_LOG_NDELAY, OPTION_LOG_NOWAIT, OPTION_LOG_ODELAY, OPTION_LOG_PERROR, OPTION_LOG_PID, OPTION_NONE, SEND_LOCAL_NAME_DEFAULT, SEND_LOCAL_NAME_DEFAULT_VALUE, SEND_LOCAL_TIMESTAMP_DEFAULT, SERVER_SHUTDOWN_WAIT_DEFAULT, SERVER_SOCKET_BACKLOG_DEFAULT, SHUTDOWN_INTERVAL, SOCK_DGRAM, SOCK_STREAM, SPLIT_MESSAGE_BEGIN_TEXT_DEFAULT, SPLIT_MESSAGE_END_TEXT_DEFAULT, STRUCTURED_DATA_APP_NAME_DEFAULT_VALUE, STRUCTURED_DATA_EMPTY_VALUE, STRUCTURED_DATA_NILVALUE, STRUCTURED_DATA_PROCESS_ID_DEFAULT_VALUE, SYSLOG_BUFFER_SIZE, SYSLOG_DATEFORMAT, SYSLOG_FACILITY_DEFAULT, SYSLOG_HOST_DEFAULT, SYSLOG_LIBRARY_DEFAULT, SYSLOG_MESSAGE_MODIFIER_PREFIX_DEFAULT, SYSLOG_MESSAGE_MODIFIER_SUFFIX_DEFAULT, SYSLOG_PATH_DEFAULT, SYSLOG_POOL_CONFIG_MAX_ACTIVE_DEFAULT, SYSLOG_POOL_CONFIG_MAX_IDLE_DEFAULT, SYSLOG_POOL_CONFIG_MAX_WAIT_DEFAULT, SYSLOG_POOL_CONFIG_MIN_EVICTABLE_IDLE_TIME_MILLIS_DEFAULT, SYSLOG_POOL_CONFIG_MIN_IDLE_DEFAULT, SYSLOG_POOL_CONFIG_NUM_TESTS_PER_EVICTION_RUN_DEFAULT, SYSLOG_POOL_CONFIG_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS_DEFAULT, SYSLOG_POOL_CONFIG_TEST_ON_BORROW_DEFAULT, SYSLOG_POOL_CONFIG_TEST_ON_RETURN_DEFAULT, SYSLOG_POOL_CONFIG_TEST_WHILE_IDLE_DEFAULT, SYSLOG_POOL_CONFIG_TIME_BETWEEN_EVICTION_RUNS_MILLIS_DEFAULT, SYSLOG_PORT_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_FIRST_NUMBER_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_LAST_NUMBER_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_PAD_CHAR_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_PREFIX_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_SUFFIX_DEFAULT, SYSLOG_SEQUENTIAL_MESSAGE_MODIFIER_USE_PADDING_DEFAULT, SYSLOG_SOCKET_FAMILY_DEFAULT, SYSLOG_SOCKET_LIBRARY_DEFAULT, SYSLOG_SOCKET_PATH_DEFAULT, SYSLOG_SOCKET_PROTOCOL_DEFAULT, SYSLOG_SOCKET_TYPE_DEFAULT, TCP, TCP_DELIMITER_SEQUENCE_DEFAULT, TCP_FRESH_CONNECTION_INTERVAL_DEFAULT, TCP_KEEP_ALIVE_DEFAULT, TCP_MAX_ACTIVE_SOCKETS_BEHAVIOR_DEFAULT, TCP_MAX_ACTIVE_SOCKETS_DEFAULT, TCP_PERSISTENT_CONNECTION_DEFAULT, TCP_REUSE_ADDRESS_DEFAULT, TCP_SET_BUFFER_SIZE_DEFAULT, TCP_SO_LINGER_DEFAULT, TCP_SO_LINGER_SECONDS_DEFAULT, THREAD_LOOP_INTERVAL_DEFAULT, THREAD_PRIORITY_DEFAULT, THREADED_DEFAULT, THROW_EXCEPTION_ON_INITIALIZE_DEFAULT, THROW_EXCEPTION_ON_WRITE_DEFAULT, TRUNCATE_MESSAGE_DEFAULT, UDP, UNIX_SOCKET, UNIX_SYSLOG, USE_DAEMON_THREAD_DEFAULT, USE_STRUCTURED_DATA_DEFAULT, WRITE_RETRIES_DEFAULT
 
Constructor Summary
Syslog4jAppender()
           
 
Method Summary
 boolean getHeader()
           
 java.lang.String getSyslogHost()
           
 java.lang.String initialize()
           
 void setHeader(boolean header)
           
 void setSyslogHost(java.lang.String host)
           
 
Methods inherited from class org.productivity.java.syslog4j.impl.log4j.Syslog4jAppenderSkeleton
_initialize, append, close, getCharSet, getFacility, getHost, getIdent, getLocalName, getMaxMessageLength, getMaxShutdownWait, getPort, getProtocol, getSplitMessageBeginText, getSplitMessageEndText, getThreaded, getThreadLoopInterval, getTruncateMessage, getUseStructuredData, getWriteRetries, isTrueOrOn, requiresLayout, setCharSet, setFacility, setHost, setIdent, setLocalName, setMaxMessageLength, setMaxShutdownWait, setPort, setProtocol, setSplitMessageBeginText, setSplitMessageEndText, setThreaded, setThreadLoopInterval, setTruncateMessage, setUseStructuredData, setWriteRetries
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Syslog4jAppender

public Syslog4jAppender()
Method Detail

initialize

public java.lang.String initialize()
Specified by:
initialize in class Syslog4jAppenderSkeleton

getHeader

public boolean getHeader()

setHeader

public void setHeader(boolean header)

getSyslogHost

public java.lang.String getSyslogHost()

setSyslogHost

public void setSyslogHost(java.lang.String host)