summaryrefslogtreecommitdiff
path: root/bin/bbackupd/BackupDaemon.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-11-23 22:01:27 +0000
committerChris Wilson <chris+github@qwirx.com>2014-11-23 22:01:27 +0000
commit3621d57a95b858236921d8a9a22fb7568e451dc7 (patch)
tree5ad3efdc9a01b81486703e001030fbcdae91b535 /bin/bbackupd/BackupDaemon.cpp
parent21413fad9f0f0987f486652cb31c1f0f45a71fb6 (diff)
Fix compile errors introduced by previous commit.
Add a LogFileOverwrite option to allow configuring whether LogFile is overwritten or appended to. Overwriting happens at startup, and the start of each backup in bbackupd (via ResetLogFile()).
Diffstat (limited to 'bin/bbackupd/BackupDaemon.cpp')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp9
1 files changed, 8 insertions, 1 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;