[Box Backup-commit] COMMIT r3424 - in box/trunk: bin/bbackupd bin/bbackupquery lib/backupclient

subversion at boxbackup.org subversion at boxbackup.org
Sun Nov 23 22:01:28 GMT 2014


Author: chris
Date: 2014-11-23 22:01:27 +0000 (Sun, 23 Nov 2014)
New Revision: 3424

Modified:
   box/trunk/bin/bbackupd/BackupDaemon.cpp
   box/trunk/bin/bbackupquery/bbackupquery.cpp
   box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp
Log:
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()).

Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemon.cpp	2014-11-16 23:12:27 UTC (rev 3423)
+++ box/trunk/bin/bbackupd/BackupDaemon.cpp	2014-11-23 22:01:27 UTC (rev 3424)
@@ -874,6 +874,12 @@
 
 	if (conf.KeyExists("LogFile"))
 	{
+		bool overwrite = false;
+		if (conf.KeyExists("LogFileOverwrite"))
+		{
+			overwrite = conf.GetKeyValueBool("LogFileOverwrite");
+		}
+
 		Log::Level level = Log::INFO;
 		if (conf.KeyExists("LogFileLevel"))
 		{
@@ -880,8 +886,9 @@
 			level = Logging::GetNamedLevel(
 				conf.GetKeyValue("LogFileLevel"));
 		}
+
 		fileLogger.reset(new FileLogger(conf.GetKeyValue("LogFile"),
-			level));
+			level, !overwrite));
 	}
 
 	std::string extendedLogFile;

Modified: box/trunk/bin/bbackupquery/bbackupquery.cpp
===================================================================
--- box/trunk/bin/bbackupquery/bbackupquery.cpp	2014-11-16 23:12:27 UTC (rev 3423)
+++ box/trunk/bin/bbackupquery/bbackupquery.cpp	2014-11-23 22:01:27 UTC (rev 3424)
@@ -309,7 +309,8 @@
 	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"));

Modified: box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp
===================================================================
--- box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp	2014-11-16 23:12:27 UTC (rev 3423)
+++ box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp	2014-11-23 22:01:27 UTC (rev 3424)
@@ -102,6 +102,8 @@
 	// 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),




More information about the Boxbackup-commit mailing list