<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:50 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>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-766] Logging al RESTCONF requests and responses</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-766</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;There should be an option to log whole RESTCONF traffic - requests and responses - without external dependency.&lt;/p&gt;

&lt;p&gt;Customer-based requirements about the contents of logs (user ID is probably one of the most important fields - native Jetty logger/LoggingFeature from Jersey will not help much):&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;timestamp (human-readable format &amp;amp; unix format - milliseconds)&lt;/li&gt;
	&lt;li&gt;log level&lt;/li&gt;
	&lt;li&gt;logging filter name&lt;/li&gt;
	&lt;li&gt;remote address&lt;/li&gt;
	&lt;li&gt;controller user ID (resolved using AAA)&lt;/li&gt;
	&lt;li&gt;request method&lt;/li&gt;
	&lt;li&gt;request URI&lt;/li&gt;
	&lt;li&gt;request body size&lt;/li&gt;
	&lt;li&gt;response code&lt;/li&gt;
	&lt;li&gt;response payload size&lt;/li&gt;
	&lt;li&gt;duration in milliseconds&lt;/li&gt;
	&lt;li&gt;request/response body&lt;/li&gt;
	&lt;li&gt;http headers&lt;/li&gt;
	&lt;li&gt;query parameters&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Next requirements:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;option to enable/disable logging at runtime + providing a configuration using cfg file in etc&lt;/li&gt;
	&lt;li&gt;option to configure whether HTTP headers, query parameters, and bodies should be part of output logs&lt;/li&gt;
	&lt;li&gt;option to hide selected headers - Authorization/Cookie&lt;/li&gt;
	&lt;li&gt;option to redirect logs to separate file - logs should be generated from separate classes, so it will be possible to easily configure log4j2 appender&lt;/li&gt;
	&lt;li&gt;simple column-based format (using &apos; | &apos; for separation of fields)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Requests and responses can be logged separately.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: we can inspire by LoggingFeature or LoggingFilter (jersey).&lt;/em&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="33863">NETCONF-766</key>
            <summary>Logging al RESTCONF requests and responses</summary>
                <type id="10103" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10311&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="10001" iconUrl="https://jira.opendaylight.org/" description="">In Review</status>
                    <statusCategory id="4" key="indeterminate" colorName="yellow"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="ppuskar">Peter Pu&#353;k&#225;r</assignee>
                                    <reporter username="jaro0149odl">Jaroslav T&#243;th</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Mar 2021 18:22:25 +0000</created>
                <updated>Thu, 7 Sep 2023 15:23:34 +0000</updated>
                                                            <fixVersion>7.0.0</fixVersion>
                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="69020" author="jaro0149odl" created="Tue, 9 Mar 2021 18:49:43 +0000"  >&lt;p&gt;proposal: &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/95439&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/95439&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;available configuration in org.opendaylight.restconf.nb.rfc8040.cfg (logging is disabled by default):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
#restconf-logging-enabled=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
#logging-headers-enabled=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
#logging-query-parameters-enabled=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
#logging-body-enabled=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
#hidden-http-headers=Authorization,Cookie
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;all logs are generated from single class - if user wants to append them to separate file, the following section can be added to org.ops4j.pax.logging.cfg:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
# RESTCONF
log4j2.appender.restconf.type = RollingRandomAccessFile
log4j2.appender.restconf.name = Restconf
log4j2.appender.restconf.fileName = ${karaf.data}/log/restconf.log
log4j2.appender.restconf.filePattern = ${karaf.data}/log/restconf.log.%i
log4j2.appender.restconf.append = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
log4j2.appender.restconf.layout.type = PatternLayout
log4j2.appender.restconf.layout.pattern = %d{ISO8601} | %-5p | %d{UNIX_MILLIS} | %c{1} | %m%n
log4j2.appender.restconf.policies.type = Policies
log4j2.appender.restconf.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.restconf.policies.size.size = 64MB
log4j2.appender.restconf.strategy.type = DefaultRolloverStrategy
log4j2.appender.restconf.strategy.max = 7log4j2.logger.restconf.name = org.opendaylight.restconf.nb.rfc8040.jersey.providers.logging.RestconfLoggingBroker
log4j2.logger.restconf.level = TRACE
log4j2.logger.restconf.additivity = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
log4j2.logger.restconf.appenderRef.Restconf.ref = Restconf
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="69021" author="demx8as6" created="Wed, 10 Mar 2021 07:52:15 +0000"  >&lt;p&gt;+1 &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03xhz:</customfieldvalue>

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