<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:41 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>[JAVA-615] Turn off warning when using command method</title>
                <link>https://jira.mongodb.org/browse/JAVA-615</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When I run the java driver method command like in the scala code below:&lt;/p&gt;

&lt;p&gt;private var db: DB = null&lt;/p&gt;

&lt;p&gt;...&lt;span class=&quot;error&quot;&gt;&amp;#91;more set up code here&amp;#93;&lt;/span&gt;..&lt;/p&gt;

&lt;p&gt;db = mongoConnection.getDB(saksApiDBName)&lt;br/&gt;
db.cleanCursors(false)&lt;/p&gt;

&lt;p&gt;and run the command&lt;/p&gt;

&lt;p&gt;db.command(&quot;isMaster&quot;);&lt;/p&gt;


&lt;p&gt;I get the expected result, what is&lt;/p&gt;
{ &quot;setName&quot; : &quot;DEVrs&quot; , &quot;ismaster&quot; : true , &quot;secondary&quot; : false , &quot;hosts&quot; : [ &quot;SD2DVD07VL.SAKSDIRECT.COM:27017&quot; , &quot;SD2DVD08VL.SAKSDIRECT.COM:27017&quot; , &quot;SD2DVD03VL:27017&quot;] , &quot;primary&quot; : &quot;SD2DVD07VL.SAKSDIRECT.COM:27017&quot; , &quot;me&quot; : &quot;SD2DVD07VL.SAKSDIRECT.COM:27017&quot; , &quot;maxBsonObjectSize&quot; : 16777216 , &quot;ok&quot; : 1.0}

&lt;p&gt;but also get warnings in the console:&lt;/p&gt;

&lt;p&gt;Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus$Node update&lt;br/&gt;
WARNING: Server seen up: SD2DVD07VL.SAKSDIRECT.COM:27017&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus findNode&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus _addIfNotHere&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus$Node update&lt;br/&gt;
WARNING: Server seen up: SD2DVD08VL.SAKSDIRECT.COM:27017&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus findNode&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus _addIfNotHere&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus$Node update&lt;br/&gt;
WARNING: Server seen up: SD2DVD03VL.SAKSDIRECT.COM:27017&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus findNode&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus _addIfNotHere&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus findNode&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus _addIfNotHere&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus findNode&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus _addIfNotHere&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus findNode&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;br/&gt;
Aug 2, 2012 11:50:09 AM com.mongodb.ReplicaSetStatus _addIfNotHere&lt;br/&gt;
WARNING: couldn&apos;t resolve host &lt;span class=&quot;error&quot;&gt;&amp;#91;SD2DVD03VL:27017&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Any of the options below are fine with me:&lt;br/&gt;
1) Is there a better way to get the hosts used in a replica set?&lt;br/&gt;
2) Can I turn off temporarily the logs exposed by the driver for that particular operation?&lt;br/&gt;
3) How to change log level?&lt;/p&gt;

&lt;p&gt;Thanks &lt;/p&gt;</description>
                <environment></environment>
        <key id="46094">JAVA-615</key>
            <summary>Turn off warning when using command method</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="samuel_irmes@s5a.com">Sam Irmes</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Aug 2012 16:00:05 +0000</created>
                <updated>Wed, 11 Sep 2019 19:13:04 +0000</updated>
                            <resolved>Fri, 3 Aug 2012 17:31:28 +0000</resolved>
                                    <version>2.0</version>
                                                    <component>Cluster Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="150380" author="jeff.yemin" created="Fri, 3 Aug 2012 17:31:28 +0000"  >&lt;p&gt;Glad to be of help.&lt;/p&gt;</comment>
                            <comment id="150361" author="samuel_irmes@s5a.com" created="Fri, 3 Aug 2012 16:56:44 +0000"  >&lt;p&gt;Got it! I am going to upgrade to 2.8.0 and change my log level (should be that).&lt;br/&gt;
Thank you very much and please feel free to close the ticket&lt;/p&gt;</comment>
                            <comment id="150348" author="jeff.yemin" created="Fri, 3 Aug 2012 16:34:21 +0000"  >&lt;p&gt;You set affect version 2.0, so I thought that&apos;s what you were using.  The current version of the driver is 2.8.0, which has many new features, bug fixes, and some performance improvements.&lt;/p&gt;

&lt;p&gt;Regarding the log level, it depends on what logging framework you&apos;re using.  Usually this is controlled via an external configuration file, but it can also be done programmatically.  If you&apos;re using Log4J, check out &lt;a href=&quot;http://logging.apache.org/log4j/1.2/manual.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://logging.apache.org/log4j/1.2/manual.html&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="150303" author="samuel_irmes@s5a.com" created="Fri, 3 Aug 2012 14:39:59 +0000"  >&lt;p&gt;Thanks, I will try the option 3 like you said. Can you tell me how to do that in my java class?&lt;br/&gt;
I could not find much information on my search.&lt;/p&gt;

&lt;p&gt;Also, we are using java driver 2.6.3. Did you see anything we could improve?&lt;/p&gt;</comment>
                            <comment id="150150" author="jeff.yemin" created="Fri, 3 Aug 2012 02:50:58 +0000"  >&lt;ol&gt;
	&lt;li&gt;ismaster is a good way to get the hosts&lt;/li&gt;
	&lt;li&gt;no&lt;/li&gt;
	&lt;li&gt;you could bump up the log level on com.mongodb.ReplicaSetStatus to ERROR.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Just curious also why you&apos;re using such an old driver version?  There have been a lot of improvements since 2.0.&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|hrhaz3:</customfieldvalue>

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