HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members
rwsf::LogRotatingFileWriter Class Reference

Provides the ability to define a rotating logger to control file size. More...

#include <rwsf/core/LogRotatingFileWriter.h>

Inheritance diagram for rwsf::LogRotatingFileWriter:
rwsf::LogFileWriter

Detailed Description

This Logger implementation writes to a file until the file reaches a specified size, and then moves the log file aside and writes to a new file, again until the specified size is reached. The parameters for the size of the file, the location of the historical backups, and the number of historical backups to keep before deleting old ones, are all configurable. To use this logger, you must specify ".createRotatingFileLogger" in the logger configuration file, typically loggers.xml. In the logger definition, the following properties must be specified:

Example of definition in logger configuration file, typically loggers.xml:

<logger name="rotating.log" class="rwsf_core.createRotatingFileLogger">
<property name="filename" value="${RWSF_HOME}/logs/agent.log"/>
<property name="formatter" value="rwsf_core.createLogTimeFormatter"/>
<property name="mode" value="append"/>
<property name="measurement" value="mb"/>
<property name="measuresize" value="1"/>
<property name="cleanup" value="y"/>
<property name="logfilenum" value="10"/>
<property name="logdir" value="${RWSF_HOME}/logs"/>
</logger>

Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.