summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2012-05-03 13:41:28 +0000
committerChris Wilson <chris+github@qwirx.com>2012-05-03 13:41:28 +0000
commit02f21ebefb9d219d6ba3b7d5c14335a8da9c6227 (patch)
tree934eae2abf339fb4fe02a8206e4107aeaeb2d5b6 /bin
parentee4de841e21d3737433d0868ba3661f0cc831224 (diff)
Tag housekeeping logging with the account number and name.
Diffstat (limited to 'bin')
-rw-r--r--bin/bbstored/BBStoreDHousekeeping.cpp26
-rw-r--r--bin/bbstored/HousekeepStoreAccount.cpp6
2 files changed, 20 insertions, 12 deletions
diff --git a/bin/bbstored/BBStoreDHousekeeping.cpp b/bin/bbstored/BBStoreDHousekeeping.cpp
index 7f799008..d0f83aed 100644
--- a/bin/bbstored/BBStoreDHousekeeping.cpp
+++ b/bin/bbstored/BBStoreDHousekeeping.cpp
@@ -100,18 +100,20 @@ void BackupStoreDaemon::RunHousekeepingIfNeeded()
{
try
{
- if(mpAccounts)
- {
- // Get the account root
- std::string rootDir;
- int discSet = 0;
- mpAccounts->GetAccountRoot(*i, rootDir, discSet);
-
- // Do housekeeping on this account
- HousekeepStoreAccount housekeeping(*i, rootDir,
- discSet, this);
- housekeeping.DoHousekeeping();
- }
+ // Tag log output to identify account
+ std::ostringstream tag;
+ tag << "hk/" << BOX_FORMAT_ACCOUNT(*i);
+ Logging::Tagger tagWithClientID(tag.str());
+
+ // Get the account root
+ std::string rootDir;
+ int discSet = 0;
+ mpAccounts->GetAccountRoot(*i, rootDir, discSet);
+
+ // Do housekeeping on this account
+ HousekeepStoreAccount housekeeping(*i, rootDir,
+ discSet, this);
+ housekeeping.DoHousekeeping();
}
catch(BoxException &e)
{
diff --git a/bin/bbstored/HousekeepStoreAccount.cpp b/bin/bbstored/HousekeepStoreAccount.cpp
index 166a58e6..dde813f9 100644
--- a/bin/bbstored/HousekeepStoreAccount.cpp
+++ b/bin/bbstored/HousekeepStoreAccount.cpp
@@ -122,6 +122,12 @@ void HousekeepStoreAccount::DoHousekeeping(bool KeepTryingForever)
BackupStoreInfo::Load(mAccountID, mStoreRoot, mStoreDiscSet,
true /* Read Only */));
+ // Tag log output to identify account
+ std::ostringstream tag;
+ tag << "hk/" << BOX_FORMAT_ACCOUNT(mAccountID) << "/" <<
+ info->GetAccountName();
+ Logging::Tagger tagWithClientID(tag.str());
+
// Calculate how much should be deleted
mDeletionSizeTarget = info->GetBlocksUsed() - info->GetBlocksSoftLimit();
if(mDeletionSizeTarget < 0)