Skip to content

Commit 64e68cf

Browse files
trondnjimwwalker
authored andcommitted
MB-59835: Add connection details to exception logging
Allows for identifying the possible attacker by logging the socket and peer name. Change-Id: I3697a0b9be864322c4e1e3662c36b123d985357a Reviewed-on: https://review.couchbase.org/c/kv_engine/+/201698 Tested-by: Jim Walker <[email protected]> Well-Formed: Restriction Checker Reviewed-by: Jim Walker <[email protected]>
1 parent e8647d1 commit 64e68cf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

daemon/connection.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,29 +717,32 @@ void Connection::logExecutionException(const std::string_view where,
717717
callstack.emplace_back(frame);
718718
});
719719
LOG_ERROR(
720-
"{}: Exception occurred during {}. Closing connection: "
720+
"{}: Exception occurred during {}. Closing connection {}: "
721721
"{}. Cookies: {} Exception thrown from: {}",
722722
getId(),
723723
where,
724+
getDescription(),
724725
e.what(),
725726
array.dump(),
726727
callstack.dump());
727728
} else {
728729
LOG_ERROR(
729-
"{}: Exception occurred during {}. Closing connection: "
730+
"{}: Exception occurred during {}. Closing connection {}: "
730731
"{}. Cookies: {}",
731732
getId(),
732733
where,
734+
getDescription(),
733735
e.what(),
734736
array.dump());
735737
}
736738
} catch (const std::exception& exception2) {
737739
try {
738740
LOG_ERROR(
739741
"{}: Second exception occurred during {}. Closing "
740-
"connection: e:{} exception2:{}",
742+
"connection {}: e:{} exception2:{}",
741743
getId(),
742744
where,
745+
getDescription(),
743746
e.what(),
744747
exception2.what());
745748
if (const auto* backtrace = cb::getBacktrace(e)) {

0 commit comments

Comments
 (0)