class Poco::PurgeByCountStrategy

Overview

This purge strategy ensures that a maximum number of archived files is not exceeded. More…

#include <PurgeStrategy.h>

class PurgeByCountStrategy: public Poco::PurgeStrategy
{
public:
    // construction

    PurgeByCountStrategy(int count);

    // methods

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

Inherited Members

public:
    // methods

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

protected:
    // methods

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

Detailed Documentation

This purge strategy ensures that a maximum number of archived files is not exceeded.

Files are deleted based on their age, with oldest files deleted first.

Methods

virtual
void
purge(const std::string& path)

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.