rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::LogTimeFormatter Class Reference
[Core Logging]

Reformats log messages with the message's log level and a timestamp. More...

#include <rwsf/core/LogTimeFormatter.h>

Inherits rwsf::LogFormatterImp.

List of all members.


Detailed Description

The LogTimeFormatter prepends the message with the message's log level and a timestamp. This information is separated by a bar (|) character.

Do not instantiate this class directly. Instead, use ".createLogTimeFormatter" in the logger configuration file when specifying a formatter property. For more information on the Agent logger, see the logging chapter in the User Guide.

The following example demonstrates using the LogTimeFormatter in a logger 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.createLogTimeFormatter"/>
  </logger>

Example of formatted output in a log file:

   INFO|2010-02-17T17:33:13,969-07:00| ConfigurationManagerStartup: Initializing Configuration Manager
   VERBOSE|2010-02-17T17:33:13,971-07:00| CM: Initializing Wsdl Config Handler

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.