[SERVER-45605] Ensure that the first log line written in a log file opened in append mode is on its own line Created: 16/Jan/20 Updated: 29/Oct/23 Resolved: 19/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0-rc0, 4.7.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Sara Williamson | 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 | ||||
| Backport Requested: |
v4.4
|
||||
| Sprint: | Dev Tools 2020-03-23 | ||||
| Participants: | |||||
| Comments |
| Comment by Githook User [ 26/Mar/20 ] |
|
Author: {'name': 'Henrik Edin', 'username': 'henrikedin', 'email': 'henrik.edin@mongodb.com'}Message: This should ensure that the first line written is always parsable. (cherry picked from commit 6f454fc655dddf3486c4e551004fbb9becb4cb4d) |
| Comment by Githook User [ 19/Mar/20 ] |
|
Author: {'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin', 'username': 'henrikedin'}Message: This should ensure that the first line written is always parsable. |
| Comment by Bruce Lucas (Inactive) [ 19/Mar/20 ] |
|
I think any parser needs to be able to gracefully handle malformed lines, and also to ignore empty lines. When this situation arises the last line of the previous instance will probably be malformed so this change won't fix that, but it will ensure that the first line isn't swallowed by that malformed line. The extra newline also would have a slight benefit of making it easier to spot on manual inspection that a restart has occurred. So I see this change as beneficial. |
| Comment by Henrik Edin [ 19/Mar/20 ] |
|
bruce.lucas Are you interested in this? The implementation would probably be to always write a new line when opening in append mode. So if nothing is wrong you'd have an empty line and the parser need to handle that. |