<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:00:38 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>[CXX-876] Custom logger ins not working</title>
                <link>https://jira.mongodb.org/browse/CXX-876</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;I&apos;m trying to enabled detailed mongo client logging with my C++ code.&lt;/p&gt;

&lt;p&gt;I&apos;ve wrote my custom logger:&lt;br/&gt;
```bash&lt;br/&gt;
class fastnetmon_mongo_logger : public mongocxx::logger {&lt;br/&gt;
    public:&lt;br/&gt;
        fastnetmon_mongo_logger() &lt;/p&gt;
{
            extern log4cpp::Category&amp;amp; logger;

            logger &amp;lt;&amp;lt; log4cpp::Priority::INFO &amp;lt;&amp;lt; &quot;Custom mongo library logger intialized&quot;;
        }

&lt;p&gt;        void operator() (mongocxx::log_level level, mongocxx::stdx::string_view domain, mongocxx::stdx::string_view message) noexcept final &lt;/p&gt;
{
            extern log4cpp::Category&amp;amp; logger;

            logger &amp;lt;&amp;lt; log4cpp::Priority::ERROR &amp;lt;&amp;lt; &quot;Log message from Mongodb driver!&quot;;
        }
&lt;p&gt;};&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;And specified it for mongo instance:&lt;br/&gt;
```bash&lt;br/&gt;
mongocxx::instance mongo_instance&lt;/p&gt;
{ mongocxx::stdx::make_unique&amp;lt;fastnetmon_mongo_logger&amp;gt;() }
&lt;p&gt; ;&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;But looks like it&apos;s not working because I haven&apos;t any log records... &lt;/p&gt;

&lt;p&gt;So also I could not find any way to specify log level logging.&lt;/p&gt;</description>
                <environment></environment>
        <key id="274575">CXX-876</key>
            <summary>Custom logger ins not working</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="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="4">Incomplete</resolution>
                                        <assignee username="andrew.morrow@mongodb.com">Andrew Morrow</assignee>
                                    <reporter username="pavel.odintsov">Pavel Odintsov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Mar 2016 16:41:27 +0000</created>
                <updated>Sat, 26 Mar 2016 20:36:02 +0000</updated>
                            <resolved>Sat, 26 Mar 2016 20:36:02 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1216148" author="acm" created="Sat, 26 Mar 2016 20:36:02 +0000"  >&lt;p&gt;Closing this as I&apos;ve not heard back in a while, but feel free to re-open it if you are still having problems.&lt;/p&gt;</comment>
                            <comment id="1214330" author="acm" created="Thu, 24 Mar 2016 19:48:42 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pavel.odintsov&quot; class=&quot;user-hover&quot; rel=&quot;pavel.odintsov&quot;&gt;pavel.odintsov&lt;/a&gt; - Did the above solutions work out for you? Is there anything more we can help you with in this ticket? Otherwise I would like to close it out.&lt;/p&gt;</comment>
                            <comment id="1212654" author="acm" created="Wed, 23 Mar 2016 16:49:23 +0000"  >&lt;p&gt;Have a look at this test for a good example:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://evergreen.mongodb.com/version/mongodb_cpp_driver_dev_14abf61eedd3e7145b8ba1cc01051c6831905105&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://evergreen.mongodb.com/version/mongodb_cpp_driver_dev_14abf61eedd3e7145b8ba1cc01051c6831905105&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1212653" author="acm" created="Wed, 23 Mar 2016 16:48:44 +0000"  >&lt;p&gt;Perhaps it is working, but the driver hasn&apos;t felt the need to log anything. After setting up your custom logger, you could try calling the C driver mongoc_log function directly to force it to log and see if your logger is called.&lt;/p&gt;

&lt;p&gt;As far as level, we call you back with the level, you decide whether to log at that level or not. There doesn&apos;t seem to be a way to tell the C driver to filter internally.&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|hrdilj:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>