PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PSystemLogToFile::RotateInfo Struct Reference

Information on how to rotate log files. More...

#include <syslog.h>

Collaboration diagram for PSystemLogToFile::RotateInfo:

Public Member Functions

 RotateInfo (const PDirectory &dir)
 
bool CanRotate () const
 

Public Attributes

PDirectory m_directory
 Destination directory for rotated file, default to same s log file. More...
 
PFilePathString m_prefix
 File name prefix, default PProcess::GetName() More...
 
PString m_timestamp
 Time template for rotated file, default "_yyyy_MM_dd_hh_mm". More...
 
PFilePathString m_suffix
 File name suffix, default ".log". More...
 
off_t m_maxSize
 Size in bytes which triggers a rotation, default zero disables. More...
 
unsigned m_maxFileCount
 When this many files have been rotated, oldest is deleted. More...
 
PTimeInterval m_maxFileAge
 Rotated files older than this are deleted. More...
 

Detailed Description

Information on how to rotate log files.

The system will generate a new file path via m_directory + m_prefix + PTime::AsString(m_timeTemplate) + m_suffix which is used with renaming/moving the log file.

The string m_directory + m_prefix + '*' + m_suffix is used to determine the files to remove.

Constructor & Destructor Documentation

PSystemLogToFile::RotateInfo::RotateInfo ( const PDirectory dir)

Member Function Documentation

bool PSystemLogToFile::RotateInfo::CanRotate ( ) const
inline

Member Data Documentation

PDirectory PSystemLogToFile::RotateInfo::m_directory

Destination directory for rotated file, default to same s log file.

PTimeInterval PSystemLogToFile::RotateInfo::m_maxFileAge

Rotated files older than this are deleted.

unsigned PSystemLogToFile::RotateInfo::m_maxFileCount

When this many files have been rotated, oldest is deleted.

off_t PSystemLogToFile::RotateInfo::m_maxSize

Size in bytes which triggers a rotation, default zero disables.

Referenced by CanRotate().

PFilePathString PSystemLogToFile::RotateInfo::m_prefix

File name prefix, default PProcess::GetName()

PFilePathString PSystemLogToFile::RotateInfo::m_suffix

File name suffix, default ".log".

PString PSystemLogToFile::RotateInfo::m_timestamp

Time template for rotated file, default "_yyyy_MM_dd_hh_mm".

Referenced by CanRotate().


The documentation for this struct was generated from the following file: