<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:21:03 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>[CDRIVER-4485] Easier debugging with standardized logging: logging specification</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4485</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;This ticket was split from &lt;tt&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1677&quot; title=&quot;Easier debugging with standardized logging: logging specification&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1677&quot;&gt;DRIVERS-1677&lt;/a&gt;&lt;/tt&gt;, please see that ticket for a detailed description. &lt;/p&gt;</description>
                <environment></environment>
        <key id="2154373">CDRIVER-4485</key>
            <summary>Easier debugging with standardized logging: logging specification</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="dbeng-pm-bot">PM Bot</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Oct 2022 15:06:57 +0000</created>
                <updated>Tue, 26 Sep 2023 13:14:02 +0000</updated>
                                                                            <component>Logging</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5695637" author="kevin.albertson" created="Mon, 11 Sep 2023 20:32:17 +0000"  >&lt;blockquote&gt;
&lt;p&gt;In that case, what would become of libmongoc&apos;s &lt;tt&gt;MONGOC_LOG_LEVEL_CRITICAL&lt;/tt&gt; value? Would it retain the same definition but remain unused?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I expect &quot;yes&quot;. &lt;tt&gt;MONGOC_LOG_LEVEL_CRITICAL&lt;/tt&gt; is part of the public API. It could be considered for deprecation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;would it be worth defining constants for the min/max values of the mongoc_log_level_t enum&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I suggest a validation function be introduced (maybe named: &lt;tt&gt;mongoc_log_level_is_valid(int);&lt;/tt&gt;), so the integer min/max values are not added to public ABI.&lt;/p&gt;</comment>
                            <comment id="5695353" author="jmikola@gmail.com" created="Mon, 11 Sep 2023 19:16:57 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kevin.albertson%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kevin.albertson@mongodb.com&quot;&gt;kevin.albertson@mongodb.com&lt;/a&gt;: In that case, what would become of libmongoc&apos;s &lt;tt&gt;MONGOC_LOG_LEVEL_CRITICAL&lt;/tt&gt; value? Would it retain the same definition but remain unused?&lt;/p&gt;

&lt;p&gt;On a related note, would it be worth defining constants for the min/max values of the &lt;tt&gt;mongoc_log_level_t&lt;/tt&gt; enum so that consumers of libmongoc can apply some validation? As I&apos;m implementing an API in &lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-2180&quot; title=&quot;Allow applications to register a LogSubscriber globally&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-2180&quot;&gt;&lt;del&gt;PHPC-2180&lt;/del&gt;&lt;/a&gt; that allows applications to both capture &lt;em&gt;and&lt;/em&gt; write log messages, I found myself wanting some way to prohibit users from sending invalid log levels. I considered just comparing the integer argument against &lt;tt&gt;MONGOC_LOG_LEVEL_TRACE&lt;/tt&gt; and &lt;tt&gt;MONGOC_LOG_LEVEL_ERROR&lt;/tt&gt; but thought that may lead to trouble down the line if additional levels are introduced to comply with the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/logging/logging.rst#log-severity-levels&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Logging spec&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="5674378" author="kevin.albertson" created="Fri, 1 Sep 2023 12:45:09 +0000"  >&lt;p&gt;The specification defines Critical as more severe than Error.&lt;br/&gt;
libmongoc defines MONGOC_LOG_LEVEL_CRITICAL as less severe than MONGOC_LOG_LEVEL_ERROR.&lt;/p&gt;

&lt;p&gt;At present, the specification does not use the Critical level. libmongoc does not log anything with MONGOC_LOG_LEVEL_CRITICAL.&lt;/p&gt;

&lt;p&gt;If the specification adds Critical log messages in the future, I propose libmongoc log those with MONGOC_LOG_LEVEL_ERROR (not MONGOC_LOG_LEVEL_CRITICAL). Drivers are expected to log Critical messages if the application is configured to log Error or more severe:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;drivers MUST emit messages for that level at the closest, less severe level if one is available, or the closest more severe level otherwise.&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2154382">PHPLIB-998</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                                                <inwardlinks description="split from">
                                        <issuelink>
            <issuekey id="1327204">DRIVERS-1677</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2158054">CDRIVER-4501</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2220978">PHPC-2180</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-3775</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0vxmw:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_21457" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Upstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1677&quot; title=&quot;Easier debugging with standardized logging: logging specification&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1677&quot;&gt;DRIVERS-1677&lt;/a&gt;:&lt;br/&gt;
I suggest that drivers do their implementation of this ticket in tandem with their implementation of &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1673&quot; title=&quot;Add log messages to Command monitoring spec&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1673&quot;&gt;DRIVERS-1673&lt;/a&gt; which adds command log messages. This way the driver will have actual log messages to emit and test and can confirm that their logging implementation and test code works as expected.&lt;/p&gt;

&lt;p&gt;The logging spec can be found &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/logging/logging.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The unified test format changes can be found &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/logging/logging.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. To summarize:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Client entities may now have a new &lt;tt&gt;observeLogMessages&lt;/tt&gt; property specifying logging configuration for the client&lt;/li&gt;
	&lt;li&gt;Tests may now have a new &lt;tt&gt;expectLogMessages&lt;/tt&gt; property specifying expected log messages to be produced during the test&lt;/li&gt;
	&lt;li&gt;Two new special matching operators &lt;tt&gt;$$matchAsRoot&lt;/tt&gt; and &lt;tt&gt;$$matchAsDocument&lt;/tt&gt; have been added to enable logging assertions.&lt;br/&gt;
&#160;&lt;/li&gt;
&lt;/ul&gt;
</customfieldvalue>

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