fixed log rotation issue

This commit is contained in:
Guenter Obiltschnig
2008-09-18 14:18:44 +00:00
parent be8daabe3c
commit b5b35cb173
5 changed files with 65 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
//
// RotateStrategy.h
//
// $Id: //poco/svn/Foundation/include/Poco/RotateStrategy.h#2 $
// $Id: //poco/1.3/Foundation/include/Poco/RotateStrategy.h#3 $
//
// Library: Foundation
// Package: Logging
@@ -114,7 +114,7 @@ public:
{
}
bool mustRotate(LogFile* pFile = 0)
bool mustRotate(LogFile* pFile)
{
if (DT() >= _threshold)
{
@@ -149,6 +149,11 @@ private:
class Foundation_API RotateByIntervalStrategy: public RotateStrategy
/// The file is rotated when the log file
/// exceeds a given age.
///
/// For this to work reliably across all platforms and file systems
/// (there are severe issues on most platforms finding out the real
/// creation date of a file), the creation date of the file is
/// written into the log file as the first entry.
{
public:
RotateByIntervalStrategy(const Timespan& span);
@@ -157,6 +162,8 @@ public:
private:
Timespan _span;
Timestamp _lastRotate;
static const std::string ROTATE_TEXT;
};