<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:09:42 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-503] debug messages</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-503</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;How do I stop the debug messages from the C driver &lt;br/&gt;
I compiled it with configure --no-debugging but that didnt work.&lt;/p&gt;

&lt;p&gt;2015/01/12 17:44:14.0105: &lt;span class=&quot;error&quot;&gt;&amp;#91;27912&amp;#93;&lt;/span&gt;:    DEBUG:      cluster: Client initialized in direct mode.&lt;/p&gt;</description>
                <environment></environment>
        <key id="178216">CDRIVER-503</key>
            <summary>debug messages</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="-1">Unassigned</assignee>
                                    <reporter username="john.page@mongodb.com">John Page</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jan 2015 17:46:41 +0000</created>
                <updated>Wed, 11 Sep 2019 19:04:53 +0000</updated>
                            <resolved>Fri, 28 Aug 2015 19:47:07 +0000</resolved>
                                                    <fixVersion>1.2-beta1</fixVersion>
                                    <component>docs</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1017358" author="bjori" created="Fri, 28 Aug 2015 19:47:07 +0000"  >&lt;p&gt;Improved the docs for 1.2, and the original message is no longer an issue in 1.2.&lt;/p&gt;

&lt;p&gt;I consider this ticket to be fixed now.&lt;/p&gt;</comment>
                            <comment id="1017338" author="xgen-internal-githook" created="Fri, 28 Aug 2015 19:33:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;bjori&apos;, u&apos;name&apos;: u&apos;Hannes Magnusson&apos;, u&apos;email&apos;: u&apos;bjori@php.net&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-794&quot; title=&quot;document mongoc_log_trace_enable / disable&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-794&quot;&gt;&lt;del&gt;CDRIVER-794&lt;/del&gt;&lt;/a&gt;: document mongoc_log_trace_enable / disable&lt;/p&gt;

&lt;p&gt;Also touch on &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-503&quot; title=&quot;debug messages&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-503&quot;&gt;&lt;del&gt;CDRIVER-503&lt;/del&gt;&lt;/a&gt; by noting how to disable all logging&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/8005ba530be1debfa56cd566d0c84802fe104d35&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/8005ba530be1debfa56cd566d0c84802fe104d35&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="997373" author="jesse" created="Wed, 5 Aug 2015 17:37:36 +0000"  >&lt;p&gt;We&apos;ll silence DEBUG-level messages by default in 1.3, and improve documentation for how to silence or redirect log messages.&lt;/p&gt;</comment>
                            <comment id="997360" author="jesse" created="Wed, 5 Aug 2015 17:29:07 +0000"  >&lt;p&gt;The &quot;unexpected&quot; message is a minor bug: the driver (correctly) considers any connection string with multiple hosts and no &quot;replicaSet&quot; option to be a list of mongoses, but it (incorrectly) logs a warning if the connection string has a &lt;b&gt;single&lt;/b&gt; host that is discovered to be a mongos, rather than a mongod. As Hannes said, this will be fixed when we release 1.2, which implements the Server Discovery And Monitoring Spec and has a rigorously defined set of expectations about your server topology:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.mongodb.org/post/99058181018/announcing-the-server-discovery-and-monitoring&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://blog.mongodb.org/post/99058181018/announcing-the-server-discovery-and-monitoring&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="997211" author="john.page" created="Wed, 5 Aug 2015 15:54:03 +0000"  >&lt;p&gt;I think info and debug should go nowhere unless asked. Critical, error and warning should possibly go to standarderror but I&apos;d rather enforce creating or at least enabling the error handler/level.&lt;/p&gt;

&lt;p&gt;C is about getting a failure return code and requesting the error message, not about handling exceptions (unless you want to start raising signals of course)&lt;/p&gt;


&lt;p&gt;I&apos;m more curious why it puts out info on connecting to a shared cluster that it&apos;s &apos;unexpected&apos; what&apos;s unexpected about it.&lt;/p&gt;</comment>
                            <comment id="997203" author="bjori" created="Wed, 5 Aug 2015 15:48:11 +0000"  >&lt;p&gt;Are you suggesting that the default log handler should be NULL? I&apos;m not opposed that idea.. Not sure if that constitutes as a BC break though?&lt;br/&gt;
In that case, what do you suggest we handle CRITICAL/ERROR/WARNING messages?&lt;/p&gt;

&lt;p&gt;The 1.2 branch implements the SDAM spec, so the topology discovery assumptions and expectations &amp;#8211; along with the messaging &amp;#8211; is completely different, so this should already be fixed there.&lt;/p&gt;
</comment>
                            <comment id="996813" author="john.page" created="Wed, 5 Aug 2015 07:43:40 +0000"  >&lt;p&gt;For me C means following UNIX principles and Info messages should have to be explicitly requested - I don&apos;t NEED to know them.&lt;/p&gt;

&lt;p&gt;Equally - what should I do when connecting to a sharded cluster so it doesn&apos;t tell me? How can I tell the C driver this is a Sharded cluster so it doesn&apos;t get a surprised and IS expecting it.&lt;/p&gt;</comment>
                            <comment id="993402" author="bjori" created="Thu, 30 Jul 2015 21:58:58 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=john.page&quot; class=&quot;user-hover&quot; rel=&quot;john.page&quot;&gt;john.page&lt;/a&gt; Thats really two different things.&lt;/p&gt;


&lt;p&gt;The debug message (MONGOC_LOG_LEVEL_DEBUG) does indeed feel awkward to print in builds without --enable-debug.&lt;br/&gt;
Similar to MONGOC_LOG_LEVEL_TRACE, it should only be printed in --enable-debug builds.&lt;/p&gt;

&lt;p&gt;As for &lt;blockquote&gt;&lt;p&gt;&quot;connect to a sharded cluster telling me its not expecting it!&quot;&lt;/p&gt;&lt;/blockquote&gt;, this is a MONGOC_LOG_LEVEL_INFO message.&lt;/p&gt;

&lt;p&gt;MONGOC_LOG_LEVEL_MESSAGE, MONGOC_LOG_LEVEL_WARNING, MONGOC_LOG_LEVEL_CRITICAL, and MONGOC_LOG_LEVEL_ERROR should however be issued as normal.&lt;/p&gt;

&lt;p&gt;The default log handler mongoc provides writes MONGOC_LOG_LEVEL_ERROR, MONGOC_LOG_LEVEL_CRITICAL &amp;amp; MONGOC_LOG_LEVEL_WARNING to stderr, while the other log levels are written to stdout.&lt;/p&gt;

&lt;p&gt;I highly suggest you provide your own log handler to catch/store/write these message and act on the CIRITICAL and ERROR levels at the very least.&lt;br/&gt;
At the moment though.. We only issue MONGOC_LOG_LEVEL_ERROR when we fail to initialize SSL, in which case I imagine a world of weird errors when establishing connection......&lt;br/&gt;
CRITICAL is currently never issued.&lt;/p&gt;

&lt;p&gt;Btw, that &quot;Client initialized in direct mode&quot; is no longer in 1.2+&lt;/p&gt;</comment>
                            <comment id="964793" author="jesse" created="Mon, 13 Jul 2015 18:40:51 +0000"  >&lt;p&gt;This will be fixed, with clear instructions, in the next minor release.&lt;/p&gt;</comment>
                            <comment id="964748" author="john.page" created="Mon, 13 Jul 2015 18:03:37 +0000"  >&lt;p&gt;That seems strange default behaviour, none of the other drivers randomly emit info messages as far as I can see. The most annoying is it complaining if I connect to a sharded cluster telling me its not expecting it!&lt;/p&gt;</comment>
                            <comment id="837327" author="jason.carey" created="Wed, 25 Feb 2015 20:36:38 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Disabling logging messages for libmongoc is somewhat cumbersome.  The trick is to define an empty log handler to pass to mongoc_log_set_handler() &lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;void        mongoc_log_set_handler     (mongoc_log_func_t   log_func,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                                        void               *user_data);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;/* The type for log_func_t : */&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;typedef void (*mongoc_log_func_t) (mongoc_log_level_t  log_level,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                                   const char         *log_domain,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                                   const char         *message,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                                   void               *user_data);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;I&apos;ll make a point of adding to the api documentation to make that more clear in the future.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Jason&lt;/p&gt;</comment>
                            <comment id="802862" author="cpei" created="Mon, 12 Jan 2015 21:51:19 +0000"  >&lt;p&gt;Yes, I also need to disable the debugging messages. but I have no idea how to.&lt;/p&gt;</comment>
                    </comments>
                    <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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrf7gv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1130</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>