rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::LogFormatter Class Reference
[Core Logging]

Reformats log messages with extra logging details. More...

#include <rwsf/core/LogFormatter.h>

Inheritance diagram for rwsf::LogFormatter:
rwsf::HandleBase

List of all members.

Public Member Functions

std::string format (Logger::LogLevel level, const std::string &message)
std::string getProlog () const
std::string getEpilog () const

Detailed Description

Log Formatters are used to reformat log messages with extra logging details, such as a timestamp or the logging level of the message. To set up an rwsf::LogFormatter for use, place the proper create method for the specific formatter in your loggers configuration file (typically <installdir>\conf\loggers.xml):

  <logger name="logger" class="rwsf_core.createFileLogger">
    <property name="filename" value="${RWSF_HOME}/logs/agent.log"/>
    <property name="formatter" value="rwsf_core.create[LogFormatterClass]"/>
  </logger>

Log Formatters should not be constructed in code. Instead use the appropriate configuration file as shown above.

See specific log formatter implementations for more information. Currently the only available implementation is rwsf::LogTimeFormatter.


Member Function Documentation

std::string rwsf::LogFormatter::format ( Logger::LogLevel  level,
const std::string &  message 
)

Formats the given logger message with log level level. The message should be a printable std::string.

std::string rwsf::LogFormatter::getEpilog (  )  const

Returns the epilog that is appended to every log message.

std::string rwsf::LogFormatter::getProlog (  )  const

Returns the prolog that is prepended to every log message.


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.