-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Log dumper #445
Feat: Log dumper #445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 294 of commit 004c2fc has completed with FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 298 of commit 28ec79b has completed with FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 300 of commit 8ce4504 has completed with FAILURE
Looks like there's a unit test for the log controller, let's extend that to test this as well. I think the most important thing to make sure of with this test is that we don't break compatibility with older configs that don't utilize this. |
9a30dd5
to
b827d6f
Compare
@chrisbeard I've added a unit test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 310 of commit a63f4e7 has completed with FAILURE
5a0a785
to
7b9f24e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 351 of commit 7b9f24e has completed with FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 358 of commit f645c26 has completed with FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 360 of commit c3ef08d has completed with FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 372 of commit 6a93d60 has completed with FAILURE
Signed-off-by: Anton Pryakhin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 378 of commit 84595e7 has completed with FAILURE
@@ -147,6 +147,9 @@ LogControllerConfig::LogControllerConfig(bslma::Allocator* allocator) | |||
, d_syslogAppName("") | |||
, d_syslogVerbosity(ball::Severity::ERROR) | |||
, d_categories(allocator) | |||
, d_recordBufferSize(32768) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this number come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default recordBufferSize
of the ball::LoggerManagerConfiguration
component we use to dump logs. We used to set it here
rc = lmc.setDefaultRecordBufferSizeIfValid(32768); |
Now it's a variable. We are going to retrieve this number from the config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this number in bytes? Can we just quickly mark the unit for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I've renamed the variable and added a comment in the same style as the variables above.
// TODO: use obj.logDump() when the config is updated | ||
// .setRecordBufferSize(obj.logDump().recordBufferSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I will remove this. This comment is a reminder to make the second step when all instances get the new version of the config. We used to leave such reminders in the past. Should we avoid them now?
// if (ball::SeverityUtil::fromAsciiCaseless( | ||
// &d_recordingVerbosity, | ||
// obj.logDump().recordingLevel().c_str()) != 0) { | ||
// errorDescription << "Invalid value for 'recordingLevel' ('" | ||
// << obj.logDump().recordingLevel() << "')"; | ||
// return -1; // RETURN | ||
// } | ||
|
||
// if (ball::SeverityUtil::fromAsciiCaseless( | ||
// &d_triggerVerbosity, | ||
// obj.logDump().triggerLevel().c_str()) != 0) { | ||
// errorDescription << "Invalid value for 'triggerLevel' ('" | ||
// << obj.logDump().triggerLevel() << "')"; | ||
// return -1; // RETURN | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// TODO: uncomment when setup of this parameter is uncommented | ||
// lc.bslsLogSeverityThreshold() = "error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this
/// might be partially altered. Refer to the component level | ||
/// documentation (section: "LogControllerConfig: Datum format") for the | ||
/// expected format of the `datum`. | ||
int fromDatum(bsl::ostream& errorDescription, const bdld::Datum& datum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use it anywhere since 2019. We use 'fromObj()' method to parse the broker config instead
Signed-off-by: Anton Pryakhin <[email protected]>
@@ -147,6 +147,9 @@ LogControllerConfig::LogControllerConfig(bslma::Allocator* allocator) | |||
, d_syslogAppName("") | |||
, d_syslogVerbosity(ball::Severity::ERROR) | |||
, d_categories(allocator) | |||
, d_recordBufferSize(32768) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this number in bytes? Can we just quickly mark the unit for it?
Co-authored-by: Taylor Foxhall <[email protected]> Signed-off-by: Anton Pryakhin <[email protected]>
Signed-off-by: Anton Pryakhin <[email protected]>
Signed-off-by: Anton Pryakhin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 397 of commit 93c314c has completed with FAILURE
Introduce a set of parameters for log record dumping by a trigger message. This section can be added to the Broker config:
Where:
recordBufferSize
is a size of default logger's record buffer in bytes.recordingLevel
is the lowest severity level of the record that will be stored by the logger in its log record buffer.triggerLevel
is the lowest severity level of the record that will cause immediate publication of that record and any records in the logger's log record buffer.