Apache log4cxx  Version 0.12.0
log4cxx::net::SocketAppenderSkeleton Class Referenceabstract

Abstract base class for SocketAppender and XMLSocketAppender. More...

#include <socketappenderskeleton.h>

Inheritance diagram for log4cxx::net::SocketAppenderSkeleton:
log4cxx::AppenderSkeleton log4cxx::Appender log4cxx::helpers::Object log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::net::SocketAppender log4cxx::net::XMLSocketAppender

Public Member Functions

 SocketAppenderSkeleton (int defaultPort, int reconnectionDelay)
 
 ~SocketAppenderSkeleton ()
 
 SocketAppenderSkeleton (helpers::InetAddressPtr address, int port, int reconnectionDelay)
 Connects to remote server at address and port. More...
 
 SocketAppenderSkeleton (const LogString &host, int port, int reconnectionDelay)
 Connects to remote server at host and port. More...
 
void activateOptions (log4cxx::helpers::Pool &p)
 Connect to the specified RemoteHost and Port. More...
 
void close ()
 Release any resources allocated within the appender such as file handles, network connections, etc. More...
 
bool requiresLayout () const
 This appender does not use a layout. More...
 
void setRemoteHost (const LogString &host)
 The RemoteHost option takes a string value which should be the host name of the server where a Apache Chainsaw or compatible is running. More...
 
const LogStringgetRemoteHost () const
 Returns value of the RemoteHost option. More...
 
void setPort (int port1)
 The Port option takes a positive integer representing the port where the server is waiting for connections. More...
 
int getPort () const
 Returns value of the Port option. More...
 
void setLocationInfo (bool locationInfo1)
 The LocationInfo option takes a boolean value. More...
 
bool getLocationInfo () const
 Returns value of the LocationInfo option. More...
 
void setReconnectionDelay (int reconnectionDelay1)
 The ReconnectionDelay option takes a positive integer representing the number of milliseconds to wait between each failed connection attempt to the server. More...
 
int getReconnectionDelay () const
 Returns value of the ReconnectionDelay option. More...
 
void fireConnector ()
 
void setOption (const LogString &option, const LogString &value)
 Set option to value. More...
 
- Public Member Functions inherited from log4cxx::AppenderSkeleton
 AppenderSkeleton ()
 
 AppenderSkeleton (const LayoutPtr &layout)
 
void finalize ()
 Finalize this appender by calling the derived class' close method. More...
 
void addFilter (const spi::FilterPtr &newFilter)
 Add a filter to end of the filter list. More...
 
void clearFilters ()
 Clear the filters chain. More...
 
const spi::ErrorHandlerPtrgetErrorHandler () const
 Return the currently set spi::ErrorHandler for this Appender. More...
 
spi::FilterPtr getFilter () const
 Returns the head Filter. More...
 
const spi::FilterPtrgetFirstFilter () const
 Return the first filter in the filter chain for this Appender. More...
 
LayoutPtr getLayout () const
 Returns the layout of this appender. More...
 
LogString getName () const
 Returns the name of this Appender. More...
 
const LevelPtrgetThreshold () const
 Returns this appenders threshold level. More...
 
bool isAsSevereAsThreshold (const LevelPtr &level) const
 Check whether the message level is below the appender's threshold. More...
 
virtual void doAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool)
 This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method. More...
 
void setErrorHandler (const spi::ErrorHandlerPtr eh)
 Set the ErrorHandler for this Appender. More...
 
void setLayout (const LayoutPtr &layout1)
 Set the layout for this appender. More...
 
void setName (const LogString &name1)
 Set the name of this Appender. More...
 
void setThreshold (const LevelPtr &threshold)
 Set the threshold level. More...
 
- Public Member Functions inherited from log4cxx::Appender
virtual ~Appender ()
 
void asdf ()
 
- Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Protected Member Functions

virtual void setSocket (log4cxx::helpers::SocketPtr &socket, log4cxx::helpers::Pool &p)=0
 
virtual void cleanUp (log4cxx::helpers::Pool &p)=0
 
virtual int getDefaultDelay () const =0
 
virtual int getDefaultPort () const =0
 
- Protected Member Functions inherited from log4cxx::AppenderSkeleton
virtual void append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p)=0
 Subclasses of AppenderSkeleton should implement this method to perform actual logging. More...
 
void doAppendImpl (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool)
 

Additional Inherited Members

- Protected Attributes inherited from log4cxx::AppenderSkeleton
LayoutPtr layout
 The layout variable does not need to be set if the appender implementation has its own layout. More...
 
LogString name
 Appenders are named. More...
 
LevelPtr threshold
 There is no level threshold filtering by default. More...
 
spi::ErrorHandlerPtr errorHandler
 It is assumed and enforced that errorHandler is never null. More...
 
spi::FilterPtr headFilter
 The first filter in the filter chain. More...
 
spi::FilterPtr tailFilter
 The last filter in the filter chain. More...
 
bool closed
 Is this appender closed? More...
 
log4cxx::helpers::Pool pool
 
log4cxx::shared_mutex mutex
 

Detailed Description

Abstract base class for SocketAppender and XMLSocketAppender.

Constructor & Destructor Documentation

◆ SocketAppenderSkeleton() [1/3]

log4cxx::net::SocketAppenderSkeleton::SocketAppenderSkeleton ( int  defaultPort,
int  reconnectionDelay 
)

◆ ~SocketAppenderSkeleton()

log4cxx::net::SocketAppenderSkeleton::~SocketAppenderSkeleton ( )

◆ SocketAppenderSkeleton() [2/3]

log4cxx::net::SocketAppenderSkeleton::SocketAppenderSkeleton ( helpers::InetAddressPtr  address,
int  port,
int  reconnectionDelay 
)

Connects to remote server at address and port.

◆ SocketAppenderSkeleton() [3/3]

log4cxx::net::SocketAppenderSkeleton::SocketAppenderSkeleton ( const LogString host,
int  port,
int  reconnectionDelay 
)

Connects to remote server at host and port.

Member Function Documentation

◆ activateOptions()

void log4cxx::net::SocketAppenderSkeleton::activateOptions ( log4cxx::helpers::Pool p)
virtual

Connect to the specified RemoteHost and Port.

Reimplemented from log4cxx::AppenderSkeleton.

◆ cleanUp()

virtual void log4cxx::net::SocketAppenderSkeleton::cleanUp ( log4cxx::helpers::Pool p)
protectedpure virtual

◆ close()

void log4cxx::net::SocketAppenderSkeleton::close ( )
virtual

Release any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.

Implements log4cxx::Appender.

◆ fireConnector()

void log4cxx::net::SocketAppenderSkeleton::fireConnector ( )

◆ getDefaultDelay()

virtual int log4cxx::net::SocketAppenderSkeleton::getDefaultDelay ( ) const
protectedpure virtual

◆ getDefaultPort()

virtual int log4cxx::net::SocketAppenderSkeleton::getDefaultPort ( ) const
protectedpure virtual

◆ getLocationInfo()

bool log4cxx::net::SocketAppenderSkeleton::getLocationInfo ( ) const
inline

Returns value of the LocationInfo option.

◆ getPort()

int log4cxx::net::SocketAppenderSkeleton::getPort ( ) const
inline

Returns value of the Port option.

◆ getReconnectionDelay()

int log4cxx::net::SocketAppenderSkeleton::getReconnectionDelay ( ) const
inline

Returns value of the ReconnectionDelay option.

◆ getRemoteHost()

const LogString& log4cxx::net::SocketAppenderSkeleton::getRemoteHost ( ) const
inline

Returns value of the RemoteHost option.

◆ requiresLayout()

bool log4cxx::net::SocketAppenderSkeleton::requiresLayout ( ) const
inlinevirtual

This appender does not use a layout.

Hence, this method returns false.

Implements log4cxx::Appender.

◆ setLocationInfo()

void log4cxx::net::SocketAppenderSkeleton::setLocationInfo ( bool  locationInfo1)
inline

The LocationInfo option takes a boolean value.

If true, the information sent to the remote host will include location information. By default no location information is sent to the server.

◆ setOption()

void log4cxx::net::SocketAppenderSkeleton::setOption ( const LogString option,
const LogString value 
)
virtual

Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.

Reimplemented from log4cxx::AppenderSkeleton.

◆ setPort()

void log4cxx::net::SocketAppenderSkeleton::setPort ( int  port1)
inline

The Port option takes a positive integer representing the port where the server is waiting for connections.

◆ setReconnectionDelay()

void log4cxx::net::SocketAppenderSkeleton::setReconnectionDelay ( int  reconnectionDelay1)
inline

The ReconnectionDelay option takes a positive integer representing the number of milliseconds to wait between each failed connection attempt to the server.

The default value of this option is 30000 which corresponds to 30 seconds.

Setting this option to zero turns off reconnection capability.

◆ setRemoteHost()

void log4cxx::net::SocketAppenderSkeleton::setRemoteHost ( const LogString host)
inline

The RemoteHost option takes a string value which should be the host name of the server where a Apache Chainsaw or compatible is running.

◆ setSocket()

virtual void log4cxx::net::SocketAppenderSkeleton::setSocket ( log4cxx::helpers::SocketPtr &  socket,
log4cxx::helpers::Pool p 
)
protectedpure virtual

The documentation for this class was generated from the following file: