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

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

public abstract class Syslog4jAppenderSkeleton
extends org.apache.log4j.AppenderSkeleton
implements SyslogConstants

Syslog4jAppenderSkeleton provides an extensible Log4j Appender wrapper for Syslog4j.

Classes which inherit Syslog4jAppenderSkeleton must implement the "initialize()" method, which sets up Syslog4j for use by the Log4j Appender.

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: Syslog4jAppenderSkeleton.java,v 1.8 2011/01/23 20:49:12 cvs Exp $
Author:
<syslog4j@productivity.org>
See Also:
Serialized Form

Field Summary
protected  java.lang.String charSet
           
protected  java.lang.String facility
           
protected  java.lang.String host
           
protected  java.lang.String ident
           
protected  boolean initialized
           
protected  java.lang.String localName
           
protected  java.lang.String maxMessageLength
           
protected  java.lang.String maxShutdownWait
           
protected  java.lang.String port
           
protected  java.lang.String protocol
           
protected  java.lang.String splitMessageBeginText
           
protected  java.lang.String splitMessageEndText
           
protected  SyslogIF syslog
           
protected  java.lang.String threaded
           
protected  java.lang.String threadLoopInterval
           
protected  java.lang.String truncateMessage
           
protected  java.lang.String useStructuredData
           
protected  java.lang.String 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
Syslog4jAppenderSkeleton()
           
 
Method Summary
protected  void _initialize()
           
protected  void append(org.apache.log4j.spi.LoggingEvent event)
           
 void close()
           
 java.lang.String getCharSet()
           
 java.lang.String getFacility()
           
 java.lang.String getHost()
           
 java.lang.String getIdent()
           
 java.lang.String getLocalName()
           
 java.lang.String getMaxMessageLength()
           
 java.lang.String getMaxShutdownWait()
           
 java.lang.String getPort()
           
 java.lang.String getProtocol()
           
 java.lang.String getSplitMessageBeginText()
           
 java.lang.String getSplitMessageEndText()
           
 java.lang.String getThreaded()
           
 java.lang.String getThreadLoopInterval()
           
 java.lang.String getTruncateMessage()
           
 java.lang.String getUseStructuredData()
           
 java.lang.String getWriteRetries()
           
abstract  java.lang.String initialize()
           
protected static boolean isTrueOrOn(java.lang.String value)
           
 boolean requiresLayout()
           
 void setCharSet(java.lang.String charSet)
           
 void setFacility(java.lang.String facility)
           
 void setHost(java.lang.String host)
           
 void setIdent(java.lang.String ident)
           
 void setLocalName(java.lang.String localName)
           
 void setMaxMessageLength(java.lang.String maxMessageLength)
           
 void setMaxShutdownWait(java.lang.String maxShutdownWait)
           
 void setPort(java.lang.String port)
           
 void setProtocol(java.lang.String protocol)
           
 void setSplitMessageBeginText(java.lang.String splitMessageBeginText)
           
 void setSplitMessageEndText(java.lang.String splitMessageEndText)
           
 void setThreaded(java.lang.String threaded)
           
 void setThreadLoopInterval(java.lang.String threadLoopInterval)
           
 void setTruncateMessage(java.lang.String truncateMessage)
           
 void setUseStructuredData(java.lang.String useStructuredData)
           
 void setWriteRetries(java.lang.String writeRetries)
           
 
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
 

Field Detail

syslog

protected SyslogIF syslog

ident

protected java.lang.String ident

localName

protected java.lang.String localName

protocol

protected java.lang.String protocol

facility

protected java.lang.String facility

host

protected java.lang.String host

port

protected java.lang.String port

charSet

protected java.lang.String charSet

threaded

protected java.lang.String threaded

threadLoopInterval

protected java.lang.String threadLoopInterval

splitMessageBeginText

protected java.lang.String splitMessageBeginText

splitMessageEndText

protected java.lang.String splitMessageEndText

maxMessageLength

protected java.lang.String maxMessageLength

maxShutdownWait

protected java.lang.String maxShutdownWait

writeRetries

protected java.lang.String writeRetries

truncateMessage

protected java.lang.String truncateMessage

useStructuredData

protected java.lang.String useStructuredData

initialized

protected boolean initialized
Constructor Detail

Syslog4jAppenderSkeleton

public Syslog4jAppenderSkeleton()
Method Detail

initialize

public abstract java.lang.String initialize()
                                     throws SyslogRuntimeException
Throws:
SyslogRuntimeException

isTrueOrOn

protected static boolean isTrueOrOn(java.lang.String value)

_initialize

protected void _initialize()

getProtocol

public java.lang.String getProtocol()

setProtocol

public void setProtocol(java.lang.String protocol)

append

protected void append(org.apache.log4j.spi.LoggingEvent event)
Specified by:
append in class org.apache.log4j.AppenderSkeleton

close

public void close()
Specified by:
close in interface org.apache.log4j.Appender

getFacility

public java.lang.String getFacility()

setFacility

public void setFacility(java.lang.String facility)

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

getLocalName

public java.lang.String getLocalName()

setLocalName

public void setLocalName(java.lang.String localName)

getPort

public java.lang.String getPort()

setPort

public void setPort(java.lang.String port)

getCharSet

public java.lang.String getCharSet()

setCharSet

public void setCharSet(java.lang.String charSet)

getIdent

public java.lang.String getIdent()

setIdent

public void setIdent(java.lang.String ident)

getThreaded

public java.lang.String getThreaded()

setThreaded

public void setThreaded(java.lang.String threaded)

requiresLayout

public boolean requiresLayout()
Specified by:
requiresLayout in interface org.apache.log4j.Appender

getThreadLoopInterval

public java.lang.String getThreadLoopInterval()

setThreadLoopInterval

public void setThreadLoopInterval(java.lang.String threadLoopInterval)

getSplitMessageBeginText

public java.lang.String getSplitMessageBeginText()

setSplitMessageBeginText

public void setSplitMessageBeginText(java.lang.String splitMessageBeginText)

getSplitMessageEndText

public java.lang.String getSplitMessageEndText()

setSplitMessageEndText

public void setSplitMessageEndText(java.lang.String splitMessageEndText)

getMaxMessageLength

public java.lang.String getMaxMessageLength()

setMaxMessageLength

public void setMaxMessageLength(java.lang.String maxMessageLength)

getMaxShutdownWait

public java.lang.String getMaxShutdownWait()

setMaxShutdownWait

public void setMaxShutdownWait(java.lang.String maxShutdownWait)

getWriteRetries

public java.lang.String getWriteRetries()

setWriteRetries

public void setWriteRetries(java.lang.String writeRetries)

getTruncateMessage

public java.lang.String getTruncateMessage()

setTruncateMessage

public void setTruncateMessage(java.lang.String truncateMessage)

getUseStructuredData

public java.lang.String getUseStructuredData()

setUseStructuredData

public void setUseStructuredData(java.lang.String useStructuredData)