[SERVER-49320] No error message produced if log file can't be created Created: 05/Jul/20 Updated: 29/Oct/23 Resolved: 22/Jul/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | 4.4.0-rc11 |
| Fix Version/s: | 4.7.0, 4.4.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bruce Lucas (Inactive) | Assignee: | Gabriel Russell (Inactive) |
| 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 | ||||
| Backport Requested: |
v4.4
|
||||
| Participants: | |||||
| Description |
|
In 4.2 if you specify a log file that can't be created an error message is written to stderr before mongod exits:
In 4.4 mongod just silently exits, giving the user no clue what the problem is. |
| Comments |
| Comment by Githook User [ 05/Oct/20 ] | |
|
Author: {'name': 'Gabriel Russell', 'email': 'gabriel.russell@mongodb.com', 'username': 'gabrielrussell'}Message: | |
| Comment by Gabriel Russell (Inactive) [ 22/Jul/20 ] | |
|
The problem was that we disabled the console logger before trying to configure the file logger, but if the file logger configuration failed then we were left with no logger. I just switched the order of disabling the console logger and enabling the file logger and the error log was no longer lost. While I was in there, I made the additional change of making the failure of configuring the file logger clearer. The only thing that let someone know that we were looking at a log configuration error was the path itself, and if the path was unknown or ambiguous, then it wasn't possible to know what was actually failing. The error log will know look like so:
| |
| Comment by Githook User [ 22/Jul/20 ] | |
|
Author: {'name': 'Gabriel Russell', 'email': 'gabriel.russell@mongodb.com', 'username': 'gabrielrussell'}Message: | |
| Comment by Githook User [ 21/Jul/20 ] | |
|
Author: {'name': 'Gabriel Russell', 'email': 'gabriel.russell@mongodb.com', 'username': 'gabrielrussell'}Message: |