[SERVER-4499] without --logappend, rotate old log Created: 15/Dec/11 Updated: 11/Jul/16 Resolved: 03/Apr/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.1 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Richard Kreuter (Inactive) | Assignee: | Brandon Diamond |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Given how useful the log file is, the server probably shouldn't default to erasing it. (This comes up in trainings a lot, that trivial operator errors can erase arbitrarily much useful historical information.) Could the server either default to logappend or try to rotate an existing log file on startup? |
| Comments |
| Comment by auto [ 04/Apr/12 ] |
|
Author: {u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}Message: |
| Comment by auto [ 03/Apr/12 ] |
|
Author: {u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}Message: |
| Comment by auto [ 03/Apr/12 ] |
|
Author: {u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}Message: |
| Comment by Richard Kreuter (Inactive) [ 10/Feb/12 ] |
|
I'm in favor of logappend-by-default. It's a minor incompatible change, we can clearly explain in the release notes, e.g., "--logappend is now the default. If you want to truncate the logfile at server startup, you should do so in your init script." |
| Comment by Brandon Diamond [ 10/Feb/12 ] |
|
After pow-wowing with Richard and Dan C, it seems as though the existing behavior is getting a bit too grizzly (especially in the presence of forking, wherein we must perform a second set of validations up front so as to ensure we can write to the log after the fork). We think the best way forward is to always append instead of the rotate logic currently in place (which causes an existing file to be renamed and a new file started). Before committing this change, I wanted to make sure this would be okay with everyone. |
| Comment by Brandon Diamond [ 09/Feb/12 ] |
|
Revisiting and writing tests. |
| Comment by Richard Kreuter (Inactive) [ 09/Feb/12 ] |
|
Please write some tests for this. Cases you need to check for: (1) log file exists at startup |
| Comment by Richard Kreuter (Inactive) [ 09/Feb/12 ] |
|
By inspection, the new behavior is doing something incorrect when there isn't an existing log file: $ ls -l /tmp/log |
| Comment by auto [ 23/Dec/11 ] |
|
Author: {u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}Message: |
| Comment by auto [ 22/Dec/11 ] |
|
Author: {u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}Message: |
| Comment by auto [ 22/Dec/11 ] |
|
Author: {u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}Message: |