[SERVER-46382] Alter LOGV2 behavior in the presence of missing attributes Created: 24/Feb/20 Updated: 29/Oct/23 Resolved: 27/Feb/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mira Carey | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Dev Tools 2020-02-24, Dev Tools 2020-03-09 | ||||||||
| Participants: | |||||||||
| Description |
|
It's my understanding that LOGV2 expressions throw when presented with attribute substitutions in the message that are not present in the overall expression. I'd like them to be fatal in debug builds and non-throwing elsewhere (perhaps logging some extra context that an attribute is missing). Failure to do this will turn typos in log statements in exception unsafe areas of code into fatal errors in production, which feels excessive. |
| Comments |
| Comment by Githook User [ 27/Feb/20 ] |
|
Author: {'name': 'Henrik Edin', 'username': 'henrikedin', 'email': 'henrik.edin@mongodb.com'}Message: Exceptions during log is fatal in debug builds only |
| Comment by Andy Schwerin [ 24/Feb/20 ] |
|
We’re still using the text logs in some codepaths, though, right? Unit tests, at least for now. |
| Comment by Henrik Edin [ 24/Feb/20 ] |
|
This applies to the plain and text formatter as the JSON one does not perform libfmt formatting. |