[SERVER-72582] Ensure stacktraces are logged from the `mongo` shell Created: 06/Jan/23  Updated: 22/Aug/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: George Wangensteen Assignee: Backlog - Security Team
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-72583 Make the mongo shell have the same de... Backlog
Assigned Teams:
Server Security
Operating System: ALL
Participants:

 Description   

Currently, if a stacktrace should be emitted from the mongo shell (i.e. user uses "printStackTrace"; an invariant fails, etc), nothing is emitted to the log.

I think this is because stacktraces are logged with severity Log() (https://github.com/mongodb/mongo/blob/8fd187d1f0c32a4d2fbf720e7f8c37b392c013b2/src/mongo/util/stacktrace.cpp#L103) to a backend that has filter for threshold Log (https://github.com/mongodb/mongo/blob/8fd187d1f0c32a4d2fbf720e7f8c37b392c013b2/src/mongo/logv2/log_domain_global.cpp#L205) , but the Shell uses LogSeverity::Info as the minimum severity it logs when not in verbose mode (https://github.com/mongodb/mongo/blob/fc021de4af28a6171e0eea8f5311268c5491876a/src/mongo/shell/shell_options.cpp#L117-L122) . Since "Info" is more severe than "Log", this means stacktraces are not logged when crashes happen / invariants fail in the shell.


Generated at Thu Feb 08 06:22:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.