class Poco::ArchiveStrategy

Overview

The ArchiveStrategy is used by FileChannel to rename a rotated log file for archiving. Moreā€¦

#include <ArchiveStrategy.h>

class ArchiveStrategy
{
public:
    // methods

    virtual
    LogFile*
    archive(LogFile* pFile) = 0;

    void
    compress(bool flag = true);

protected:
    // methods

    void
    moveFile(
        const std::string& oldName,
        const std::string& newName
        );

    bool
    exists(const std::string& name);
};

// direct descendants

class ArchiveByNumberStrategy;

template <class DT>
class ArchiveByTimestampStrategy;

Detailed Documentation

The ArchiveStrategy is used by FileChannel to rename a rotated log file for archiving.

Archived files can be automatically compressed, using the gzip file format.

Methods

virtual
LogFile*
archive(LogFile* pFile) = 0

Renames the given log file for archiving and creates and returns a new log file.

The given LogFile object is deleted.

void
compress(bool flag = true)

Enables or disables compression of archived files.