summaryrefslogtreecommitdiff
path: root/src/mongo/logger/log_domain.h
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2013-11-25 09:48:42 -0500
committerEric Milkie <milkie@10gen.com>2013-11-25 09:49:08 -0500
commit7fdecdbe6901c23faf9febd1d52368218375877f (patch)
treeaf7d1b0518376f666e8ba34a99856da3dab0acaa /src/mongo/logger/log_domain.h
parent95586f19acca1258a819930e206100efb1ce4000 (diff)
downloadmongo-7fdecdbe6901c23faf9febd1d52368218375877f.tar.gz
SERVER-11028 new abortOnFailure property of log domains
Diffstat (limited to 'src/mongo/logger/log_domain.h')
-rw-r--r--src/mongo/logger/log_domain.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mongo/logger/log_domain.h b/src/mongo/logger/log_domain.h
index b1f6dcb81f3..940958d7f8b 100644
--- a/src/mongo/logger/log_domain.h
+++ b/src/mongo/logger/log_domain.h
@@ -77,10 +77,11 @@ namespace logger {
/**
* Receives an event for logging, calling append(event) on all attached appenders.
*
- * TODO(schwerin): Should we return failed statuses somehow? vector<AppenderHandle, Status>
- * for failed appends, e.g.?
+ * If any appender fails, the behavior is determined by the abortOnFailure flag:
+ * *If abortOnFailure is set, ::abort() is immediately called.
+ * *If abortOnFailure is not set, the error is returned and no further appenders are called.
*/
- void append(const Event& event);
+ Status append(const Event& event);
/**
* Predicate that answers the question, "Should I, the caller, append to you, the log
@@ -98,6 +99,15 @@ namespace logger {
*/
void setMinimumLoggedSeverity(LogSeverity severity) { _minimumLoggedSeverity = severity; }
+ /**
+ * Gets the state of the abortOnFailure flag.
+ */
+ bool getAbortOnFailure() const { return _abortOnFailure; }
+
+ /**
+ * Sets the state of the abortOnFailure flag.
+ */
+ void setAbortOnFailure(bool abortOnFailure) { _abortOnFailure = abortOnFailure; }
//
// Configuration methods. Must be synchronized with each other and calls to "append" by the
@@ -127,6 +137,7 @@ namespace logger {
LogSeverity _minimumLoggedSeverity;
AppenderVector _appenders;
+ bool _abortOnFailure;
};
} // namespace logger