class PurgeStrategy

Library: Foundation
Package: Logging
Header: Poco/PurgeStrategy.h


The PurgeStrategy is used by FileChannel to purge archived log files.


Known Derived Classes: PurgeByAgeStrategy, PurgeByCountStrategy

Member Summary

Member Functions: list, purge





~PurgeStrategy virtual

virtual ~PurgeStrategy();

Member Functions

purge virtual

virtual void purge(
    const std::string & path
) = 0;

Purges archived log files. The path to the current "hot" log file is given. To find archived log files, look for files with a name consisting of the given path plus any suffix (e.g., .1, .20050929081500, .1.gz). A list of archived files can be obtained by calling the list() method.

list protected

void list(
    const std::string & path,
    std::vector < File > & files

Fills the given vector with a list of archived log files. The path of the current "hot" log file is given in path.

All files with the same name as the one given in path, plus some suffix (e.g., .1, .20050929081500, .1.gz) are considered archived files.