activemq::logger::Handler Class Reference

#include <Handler.h>

Inheritance diagram for activemq::logger::Handler:

activemq::logger::StreamHandler List of all members.

Public Member Functions

virtual ~Handler (void)
virtual void flush (void)=0
virtual void publish (const LogRecord &record)=0
virtual void isLoggable (const LogRecord &record)=0
virtual void setFilter (const Filter *filter)=0
virtual const Filter * getFilter (void)=0
virtual void setLevel (Level value)=0
virtual Level getLevel (void)=0
virtual void setFormatter (const Formatter *formatter)=0
virtual const Formatter * getFormatter (void)=0

Detailed Description

A Handler object takes log messages from a Logger and exports them. It might for example, write them to a console or write them to a file, or send them to a network logging service, or forward them to an OS log, or whatever.

A Handler can be disabled by doing a setLevel(Level.OFF) and can be re-enabled by doing a setLevel with an appropriate level.

Handler classes typically use LogManager properties to set default values for the Handler's Filter, Formatter, and Level. See the specific documentation for each concrete Handler class.


Constructor & Destructor Documentation

virtual activemq::logger::Handler::~Handler (  void   )  [inline, virtual]
 


Member Function Documentation

virtual void activemq::logger::Handler::flush (  void   )  [pure virtual]
 

Flush the Handler's output, clears any buffers.

Implemented in activemq::logger::StreamHandler.

virtual const Filter* activemq::logger::Handler::getFilter (  void   )  [pure virtual]
 

Gets the Filter that this Handler uses to filter Log Records

Returns:
Filter derived instance

Implemented in activemq::logger::StreamHandler.

virtual const Formatter* activemq::logger::Handler::getFormatter (  void   )  [pure virtual]
 

Gets the Formatter used by this Handler

Returns:
Filter derived instance

Implemented in activemq::logger::StreamHandler.

virtual Level activemq::logger::Handler::getLevel (  void   )  [pure virtual]
 

Get the log level specifying which message levels will be logged by this Handler.

Returns:
Level enumeration value

Implemented in activemq::logger::StreamHandler.

virtual void activemq::logger::Handler::isLoggable (  const LogRecord &  record  )  [pure virtual]
 

Check if this Handler would actually log a given LogRecord.

This method checks if the LogRecord has an appropriate Level and whether it satisfies any Filter. It also may make other Handler specific checks that might prevent a handler from logging the LogRecord.

Parameters:
record LogRecord to check

Implemented in activemq::logger::StreamHandler.

virtual void activemq::logger::Handler::publish (  const LogRecord &  record  )  [pure virtual]
 

Publish the Log Record to this Handler

Parameters:
record The Log Record to Publish

Implemented in activemq::logger::StreamHandler.

virtual void activemq::logger::Handler::setFilter (  const Filter *  filter  )  [pure virtual]
 

Sets the Filter that this Handler uses to filter Log Records

For each call of publish the Handler will call this Filter (if it is non-null) to check if the LogRecord should be published or discarded.

Parameters:
filter Filter derived instance

Implemented in activemq::logger::StreamHandler.

virtual void activemq::logger::Handler::setFormatter (  const Formatter *  formatter  )  [pure virtual]
 

Sets the Formatter used by this Handler

Some Handlers may not use Formatters, in which case the Formatter will be remembered, but not used.

Parameters:
formatter Filter derived instance

Implemented in activemq::logger::StreamHandler.

virtual void activemq::logger::Handler::setLevel (  Level  value  )  [pure virtual]
 

Set the log level specifying which message levels will be logged by this Handler.

The intention is to allow developers to turn on voluminous logging, but to limit the messages that are sent to certain Handlers.

Parameters:
value Level enumeration value

Implemented in activemq::logger::StreamHandler.


The documentation for this class was generated from the following file:
Generated on Thu Aug 3 18:03:33 2006 for activemq-cpp by  doxygen 1.4.5