HydraExpress™ C++ 2020 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Provides the ability to define a rotating logger to control file size. More...
#include <rwsf/core/LogRotatingFileWriter.h>
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:
filename
The file to log to. Historical backups have a "." and a timestamp string appended to the file name.measurement
The measurement unit to use for the measuresize value. Possible values are bit
, kb
, mb
, or gb
.measuresize
The number of units to limit the log files to before renaming them and logging to a new file.mode
(optional) Set to overwrite
if you want the file to be overwritten on every startup, and append
if you want to continue writing to the existing file. Defaults to overwrite
.formatter
(optional) The line formatter. Usually rwsf_core.createLogTimeFormatter
. Defaults to no special formatting.cleanup
(optional) Specify y
if you want old files to be cleaned up. You must also specify logfilenum. Defaults to n
.logfilenum
(optional) If cleanup is turned on, specify how many backup files to keep. Defaults to 0
, which keeps no files.logdir
(optional) If cleanup is turned on, this must identify the directory that contains the historical backups.Example of definition in logger configuration file, typically loggers.xml:
Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved. |