OW_NAMESPACE::LogAppender Class Reference

#include <OW_LogAppender.hpp>

Inheritance diagram for OW_NAMESPACE::LogAppender:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::LogAppender:

Collaboration graph
[legend]
List of all members.

Public Types

typedef SortedVectorMap< String,
String
ConfigMap

Public Member Functions

virtual ~LogAppender ()
void logMessage (const LogMessage &message) const
 Log a message using the specified component and category.
bool categoryIsEnabled (const String &category) const
bool componentAndCategoryAreEnabled (const String &component, const String &category) const
ELogLevel getLogLevel () const

Static Public Member Functions

static LogAppenderRef createLogAppender (const String &name, const StringArray &components, const StringArray &categories, const String &messageFormat, const String &type, const ConfigMap &configItems)
 Create a concrete log appender depending on the type string passed in.

Static Public Attributes

static const StringArray ALL_COMPONENTS
 Pass to createLogAppender to indicate all components.
static const StringArray ALL_CATEGORIES
 Pass to createLogAppender to indicate all categories.
static const String STR_TTCC_MESSAGE_FORMAT
 The Log4j TTCC message format - TTCC is acronym for Time Thread Category Component.
static const String TYPE_SYSLOG
 String of the type of the syslog log appender.
static const String TYPE_STDERR
 String of the type of the stderr log appender.
static const String TYPE_FILE
 String of the type of the file log appender.
static const String TYPE_NULL
 String of the type of the null log appender.

Protected Member Functions

 LogAppender (const StringArray &components, const StringArray &categories, const String &pattern)

Private Member Functions

virtual void doProcessLogMessage (const String &formattedMessage, const LogMessage &message) const =0

Private Attributes

SortedVectorSet< Stringm_components
bool m_allComponents
SortedVectorSet< Stringm_categories
bool m_allCategories
LogMessagePatternFormatter m_formatter

Detailed Description

Definition at line 53 of file OW_LogAppender.hpp.


Member Typedef Documentation

typedef SortedVectorMap<String, String> OW_NAMESPACE::LogAppender::ConfigMap
 

Definition at line 70 of file OW_LogAppender.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::LogAppender::~LogAppender  )  [virtual]
 

Definition at line 90 of file OW_LogAppender.cpp.

OW_NAMESPACE::LogAppender::LogAppender const StringArray components,
const StringArray categories,
const String pattern
[protected]
 

Definition at line 68 of file OW_LogAppender.cpp.

References OW_NAMESPACE::SortedVectorSet< T, Compare >::count(), m_allCategories, m_allComponents, m_categories, and m_components.


Member Function Documentation

bool OW_NAMESPACE::LogAppender::categoryIsEnabled const String category  )  const
 

Definition at line 96 of file OW_LogAppender.cpp.

References OW_NAMESPACE::SortedVectorSet< T, Compare >::count(), m_allCategories, and m_categories.

Referenced by componentAndCategoryAreEnabled(), and getLogLevel().

bool OW_NAMESPACE::LogAppender::componentAndCategoryAreEnabled const String component,
const String category
const
 

Definition at line 103 of file OW_LogAppender.cpp.

References categoryIsEnabled(), OW_NAMESPACE::SortedVectorSet< T, Compare >::count(), m_allComponents, and m_components.

Referenced by logMessage().

LogAppenderRef OW_NAMESPACE::LogAppender::createLogAppender const String name,
const StringArray components,
const StringArray categories,
const String messageFormat,
const String type,
const ConfigMap configItems
[static]
 

Create a concrete log appender depending on the type string passed in.

If type == "syslog" a logger the writes to the syslog will be returned. If type == "" || type == "null" a logger that doesn't do anything will be returned. If type == "stderr" a logger that writes to stderr will be returned. Otherwise type is treated as a filename and a logger that writes to that file will be returned.

Parameters:
name The name of the logger to create
components The message components the logger will log. "*" means all components.
categories The message categories the logger will log. "*" means all categories.
type The type of logger to create
configItems Additional config items the logger may use for configuration.
Returns:
a class that implements the Logger interface.
Exceptions:
LoggerException - E_UNKNOWN_LOG_APPENDER_TYPE - if type is unkonwn.
  • E_INVALID_MAX_FILE_SIZE - if the max_file_size option is invalid
  • E_INVALID_MAX_BACKUP_INDEX - if the max_backup_index option is invalid

Definition at line 159 of file OW_LogAppender.cpp.

References type, and TYPE_NULL.

Referenced by OW_NAMESPACE::Logger::createLogger().

virtual void OW_NAMESPACE::LogAppender::doProcessLogMessage const String formattedMessage,
const LogMessage message
const [private, pure virtual]
 

Implemented in OW_NAMESPACE::CerrAppender, OW_NAMESPACE::FileAppender, OW_NAMESPACE::NullAppender, and OW_NAMESPACE::SyslogAppender.

Referenced by logMessage().

ELogLevel OW_NAMESPACE::LogAppender::getLogLevel  )  const
 

Definition at line 111 of file OW_LogAppender.cpp.

References categoryIsEnabled(), OW_NAMESPACE::SortedVectorSet< T, Compare >::count(), OW_NAMESPACE::E_DEBUG_LEVEL, OW_NAMESPACE::E_ERROR_LEVEL, OW_NAMESPACE::E_FATAL_ERROR_LEVEL, OW_NAMESPACE::E_INFO_LEVEL, m_allCategories, m_categories, OW_ASSERTMSG, OW_NAMESPACE::SortedVectorSet< T, Compare >::size(), OW_NAMESPACE::Logger::STR_DEBUG_CATEGORY, OW_NAMESPACE::Logger::STR_ERROR_CATEGORY, OW_NAMESPACE::Logger::STR_FATAL_CATEGORY, and OW_NAMESPACE::Logger::STR_INFO_CATEGORY.

void OW_NAMESPACE::LogAppender::logMessage const LogMessage message  )  const
 

Log a message using the specified component and category.

Parameters:
message The message to log

Definition at line 79 of file OW_LogAppender.cpp.

References OW_NAMESPACE::LogMessage::category, OW_NAMESPACE::LogMessage::component, componentAndCategoryAreEnabled(), doProcessLogMessage(), OW_NAMESPACE::LogMessagePatternFormatter::formatMessage(), m_formatter, and OW_NAMESPACE::StringBuffer::releaseString().


Member Data Documentation

const StringArray OW_NAMESPACE::LogAppender::ALL_CATEGORIES [static]
 

Pass to createLogAppender to indicate all categories.

Definition at line 106 of file OW_LogAppender.hpp.

Referenced by OW_NAMESPACE::Logger::createLogger().

const StringArray OW_NAMESPACE::LogAppender::ALL_COMPONENTS [static]
 

Pass to createLogAppender to indicate all components.

Definition at line 104 of file OW_LogAppender.hpp.

Referenced by OW_NAMESPACE::Logger::createLogger().

bool OW_NAMESPACE::LogAppender::m_allCategories [private]
 

Definition at line 130 of file OW_LogAppender.hpp.

Referenced by categoryIsEnabled(), getLogLevel(), and LogAppender().

bool OW_NAMESPACE::LogAppender::m_allComponents [private]
 

Definition at line 128 of file OW_LogAppender.hpp.

Referenced by componentAndCategoryAreEnabled(), and LogAppender().

SortedVectorSet<String> OW_NAMESPACE::LogAppender::m_categories [private]
 

Definition at line 129 of file OW_LogAppender.hpp.

Referenced by categoryIsEnabled(), getLogLevel(), and LogAppender().

SortedVectorSet<String> OW_NAMESPACE::LogAppender::m_components [private]
 

Definition at line 127 of file OW_LogAppender.hpp.

Referenced by componentAndCategoryAreEnabled(), and LogAppender().

LogMessagePatternFormatter OW_NAMESPACE::LogAppender::m_formatter [private]
 

Definition at line 132 of file OW_LogAppender.hpp.

Referenced by logMessage().

const String OW_NAMESPACE::LogAppender::STR_TTCC_MESSAGE_FORMAT [static]
 

The Log4j TTCC message format - TTCC is acronym for Time Thread Category Component.

"%r [%t] %-5p %c - %m"

Definition at line 109 of file OW_LogAppender.hpp.

const String OW_NAMESPACE::LogAppender::TYPE_FILE [static]
 

String of the type of the file log appender.

Definition at line 115 of file OW_LogAppender.hpp.

Referenced by OW_NAMESPACE::Logger::createLogger().

const String OW_NAMESPACE::LogAppender::TYPE_NULL [static]
 

String of the type of the null log appender.

Definition at line 117 of file OW_LogAppender.hpp.

Referenced by createLogAppender(), and OW_NAMESPACE::Logger::createLogger().

const String OW_NAMESPACE::LogAppender::TYPE_STDERR [static]
 

String of the type of the stderr log appender.

Definition at line 113 of file OW_LogAppender.hpp.

Referenced by OW_NAMESPACE::Logger::createLogger().

const String OW_NAMESPACE::LogAppender::TYPE_SYSLOG [static]
 

String of the type of the syslog log appender.

Definition at line 111 of file OW_LogAppender.hpp.

Referenced by OW_NAMESPACE::Logger::createLogger().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:13:55 2006 for openwbem by  doxygen 1.4.6