[SERVER-49745] Subtle undocumented difference between LOGV2 and LOGV2_INFO. Created: 20/Jul/20 Updated: 06/Jan/23 Resolved: 19/Apr/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Backlog - Security Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Server Security
|
||||||||||||||||
| Sprint: | Security 2020-09-21 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
There's a subtlety that is disorienting, between LogSeverity::Log and LogSeverity::Info, because they appear identical in the log output, but they respond to verbosity filters as distinct severity levels. the `Log` severity is 0, and the `Info` severity is -1. These severities, though distinct internally, will both appear as an "s":"I" in the log output. As a result, it's unclear to users when to use LOGV2_INFO and when to use the default LOGV2. Guidance and documentation on this severity folding behavior would helpful. === Slack transcript (or approximation thereof) === Billy Donahue Today at 2:23 PM louis.williams 31 minutes ago louis.williams 31 minutes ago The severity appears in the "s" key of the json output object. Just testing locally, the “s” field is “I” for both LOGV2 and LOGV2_INFO https://github.com/mongodb/mongo/blob/master/src/mongo/logv2/log_severity.cpp#L69 <=where the magic happens. I think it's definitely worth a ticket. That line in log_severity.cpp is very subtle and needs user-facing documentation. |
| Comments |
| Comment by Gabriel Russell (Inactive) [ 31/Jul/20 ] |
|
FYI, this is not a difference new to logv2. This behavior is just carried over from the legacy logger. |
| Comment by Billy Donahue [ 20/Jul/20 ] |
|
louis.williams FYI |