<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:07:19 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-4905] logRotate should conform to standard log rotation mechanisms</title>
                <link>https://jira.mongodb.org/browse/SERVER-4905</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;logrotate is a system handler that deals with log files. It is a commonly-used solution across most popular linux distributions.&lt;/p&gt;

&lt;p&gt;MongoDB server files are always open by the server, from documentations it shows that one should call the &quot;logRotate&quot; method, either from a signal or through the mongo shell.&lt;/p&gt;

&lt;p&gt;Since the logRotate command names the files in a non-logrotate valid format, handling these is not a good solution for automatic &quot;rolling&quot; logs, that auto-expire based on directives.&lt;/p&gt;

&lt;p&gt;I believe the code that handles the naming is here: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/util/log.cpp#L108-127&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/master/src/mongo/util/log.cpp#L108-127&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here&apos;s a user&apos;s solution on handling the logrotation, and it seems a little like overkill: &lt;a href=&quot;http://syslog.warten.de/2011/08/logrotate-with-mongodb/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://syslog.warten.de/2011/08/logrotate-with-mongodb/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the man page:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
	&lt;li&gt;dateext&lt;br/&gt;
Archive old versions of log files adding a daily extension like YYYYMMDD instead of simply adding a number. The extension may be configured using the dateformat option.&lt;/li&gt;
	&lt;li&gt;dateformat format_string&lt;br/&gt;
Specify the extension for dateext using the notation similar to strftime(3) function. Only %Y %m %d and %s specifiers are allowed. The default value is -%Y%m%d. Note that also the character separating log name from the extension is part of the dateformat string. The system clock must be set past Sep 9th 2001 for %s to work correctly. Note that the datestamps generated by this format must be lexically sortable (i.e., first the year, then the month then the day. e.g., 2001/12/01 is ok, but 01/12/2001 is not, since 01/11/2002 would sort lower while it is later). This is because when using the rotate option, logrotate sorts all rotated filenames to find out which logfiles are older and should be removed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Logroate (without copytruncate directive) moves the current (open) file to filename.1 (and any older ones to .2 ,.3 etc).&lt;br/&gt;
Then, in the postrotate directive, it issues a command to the mongod process to start writing to a new file.&lt;/p&gt;

&lt;p&gt;So it seems like we should be allowing logrotate to handle the naming, expiration, either by default, or by a variable in the logRotate method, or possible a differenc command like &quot;startNewLogFile&quot; or something.&lt;/p&gt;</description>
                <environment>linux (ubuntu/centos)</environment>
        <key id="30138">SERVER-4905</key>
            <summary>logRotate should conform to standard log rotation mechanisms</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="mark.benvenuto@mongodb.com">Mark Benvenuto</assignee>
                                    <reporter username="miketheman">Michael A. Fiedler</reporter>
                        <labels>
                            <label>cap-ticket-needed</label>
                            <label>community-team</label>
                    </labels>
                <created>Tue, 7 Feb 2012 22:44:01 +0000</created>
                <updated>Tue, 27 Oct 2015 14:57:36 +0000</updated>
                            <resolved>Tue, 10 Jun 2014 15:08:35 +0000</resolved>
                                    <version>2.0.2</version>
                    <version>2.1.0</version>
                                    <fixVersion>2.7.2</fixVersion>
                                    <component>Logging</component>
                                        <votes>23</votes>
                                    <watches>27</watches>
                                                                                                                <comments>
                            <comment id="611911" author="xgen-internal-githook" created="Fri, 6 Jun 2014 22:20:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;markbenvenuto&apos;, u&apos;name&apos;: u&apos;Mark Benvenuto&apos;, u&apos;email&apos;: u&apos;mark.benvenuto@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4905&quot; title=&quot;logRotate should conform to standard log rotation mechanisms&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4905&quot;&gt;&lt;del&gt;SERVER-4905&lt;/del&gt;&lt;/a&gt;: add flag to disable mongo&apos;s builtin log rotation&lt;/p&gt;

&lt;p&gt;To support the standalone utility, we need to give administrators&lt;br/&gt;
support for disabling Mongo&apos;s builtin log rotation.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/616461d294bd9f5054ca38b302b6fc5d70fde20c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/616461d294bd9f5054ca38b302b6fc5d70fde20c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="386208" author="schwerin" created="Mon, 22 Jul 2013 14:36:35 +0000"  >&lt;p&gt;With the resolution of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10084&quot; title=&quot;Logging infrastructure improvements for auditing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10084&quot;&gt;&lt;del&gt;SERVER-10084&lt;/del&gt;&lt;/a&gt;, this task should be pretty straightforward to implement.  The RotatableFileWriter and RotatableFileManager classes in mongo::logger manage concurrency around writing and rotating log files.  Right now, they have DIY rotation logic, but enhancing them to support a &quot;reopen on rotate signal&quot; behavior would be straightforward.  I think the correct implementation is to make a configuration option to mongod that configures the meaning of the log rotate signal / logRotate command.  You could set it to &quot;mongod should rotate the file itself&quot; (current behavior) or to &quot;mongod should just close the existing log file descriptor and reopen using the original --logpath file name.&quot;  The latter setting would let users with their own log rotation tools use them.&lt;/p&gt;

&lt;p&gt;I imagine that RFW would get a new &quot;reopen&quot; method, and RFM would get a reopenAll() method.  Then, it&apos;s just a matter of configuring the behavior of the rotateLogs() method in mongo/util/log.cpp to call manager-&amp;gt;reopenAll() instead of rotateAll(), when the user has configured mongod in that manner.  Choosing a startup-time setParameter or a command line parameter name is probably the hardest part of the task.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="52776">SERVER-7312</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="21493">DOCS-46</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="129479">SERVER-13493</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="93309">SERVER-11087</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="71953">SERVER-9358</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="138056">SERVER-14053</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="168448">DOCS-4334</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="28781">SERVER-4739</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="29300">SERVER-4797</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="13206">SERVER-1865</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10220">
                    <name>Tested</name>
                                            <outwardlinks description="tested by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 7 Feb 2013 13:16:04 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 36 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 36 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10249"><![CDATA[Cannot]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>mark.benvenuto@mongodb.com</customfieldvalue>
            <customfieldvalue>miketheman</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hroe3z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrfy1r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5880</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="174">Server 2.7.2</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsztin:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>