summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/bbackupd/BackupDaemon.cpp9
-rw-r--r--bin/bbackupquery/bbackupquery.cpp3
-rw-r--r--lib/backupclient/BackupDaemonConfigVerify.cpp2
3 files changed, 12 insertions, 2 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 79482e21..7ed5222f 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -874,14 +874,21 @@ std::auto_ptr<BackupClientContext> BackupDaemon::RunSyncNow()
if (conf.KeyExists("LogFile"))
{
+ bool overwrite = false;
+ if (conf.KeyExists("LogFileOverwrite"))
+ {
+ overwrite = conf.GetKeyValueBool("LogFileOverwrite");
+ }
+
Log::Level level = Log::INFO;
if (conf.KeyExists("LogFileLevel"))
{
level = Logging::GetNamedLevel(
conf.GetKeyValue("LogFileLevel"));
}
+
fileLogger.reset(new FileLogger(conf.GetKeyValue("LogFile"),
- level));
+ level, !overwrite));
}
std::string extendedLogFile;
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp
index 62315b12..e10c48fe 100644
--- a/bin/bbackupquery/bbackupquery.cpp
+++ b/bin/bbackupquery/bbackupquery.cpp
@@ -309,7 +309,8 @@ int main(int argc, const char *argv[])
std::auto_ptr<FileLogger> fileLogger;
if (fileLogLevel != Log::INVALID)
{
- fileLogger.reset(new FileLogger(fileLogFile, fileLogLevel));
+ fileLogger.reset(new FileLogger(fileLogFile, fileLogLevel,
+ true)); // open in append mode
}
BOX_NOTICE(BANNER_TEXT("Backup Query Tool"));
diff --git a/lib/backupclient/BackupDaemonConfigVerify.cpp b/lib/backupclient/BackupDaemonConfigVerify.cpp
index a3b95335..8f8746b5 100644
--- a/lib/backupclient/BackupDaemonConfigVerify.cpp
+++ b/lib/backupclient/BackupDaemonConfigVerify.cpp
@@ -102,6 +102,8 @@ static const ConfigurationVerifyKey verifyrootkeys[] =
// enable logging to a file
ConfigurationVerifyKey("LogFileLevel", 0),
// set the level of verbosity of file logging
+ ConfigurationVerifyKey("LogFileOverwrite", ConfigTest_IsBool, false),
+ // overwrite the log file on each backup
ConfigurationVerifyKey("CommandSocket", 0),
// not compulsory to have this
ConfigurationVerifyKey("KeepAliveTime", ConfigTest_IsInt),