<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: &gt;= 2.7.0</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<p dir="auto">issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="537432466" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/5480" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/5480/hovercard" href="https://github.com/apache/dubbo/issues/5480">#5480</a></p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<p dir="auto">用户从dubbo 2.6.x升级到apache dubbo 2.7.x时，会存在一些兼容依赖缺失，比如AbstractRegistry、LoggerXxx和其他扩展点兼容问题，导致一些扩展dubbo的一些组件无法良好工作。</p>
<p dir="auto">期望&amp;建议：</p>
<ul dir="auto">
<li>dubbo 2.7.x 中compatible的模块剥离成独立repository, 形成复用依赖</li>
<li>对独立的compatible repository做扩展点梳理和依赖增强(支持更完善)</li>
<li>用户dubbo 2.6.x升级上来时，一些扩展能力和基础组件（比如sdk），添加对应 compatible依赖都可以良好工作，提升用户使用体验</li>
</ul>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3(with maven groupId: org.apache.dubbo) (upgrade from 2.6.5 with groupId: com.alibaba)</li>
<li>Operating System version: CentOS Linux release 7.3.1611 (Core)</li>
<li>Java version: Oracle JDK 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>(Dubbo 2.6.5) Provider-side program with <code class="notranslate">provider.xml</code> (Spring-Context-Configuration), which without <code class="notranslate">metadata-report</code> configuration. And accesslog enabled:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;dubbo:protocol name=&quot;dubbo&quot; port=&quot;21881&quot; server=&quot;netty&quot; register=&quot;true&quot; accesslog=&quot;logs/access.log&quot;/&gt;
    &lt;!-- 接口的位置 --&gt;
    &lt;dubbo:service interface=&quot;xxx.xxx.xxxService&quot;
                   ref=&quot;xxxService&quot; timeout=&quot;10000&quot; retries=&quot;3&quot;
                   executes=&quot;100&quot; loadbalance=&quot;leastactive&quot;
                   accesslog=&quot;logs/access-xxx.log&quot; register=&quot;true&quot;
                   owner=&quot;jk&quot; group=&quot;gp&quot; version=&quot;1.0&quot; /&gt;"><pre class="notranslate"><code class="notranslate">&lt;dubbo:protocol name="dubbo" port="21881" server="netty" register="true" accesslog="logs/access.log"/&gt;
    &lt;!-- 接口的位置 --&gt;
    &lt;dubbo:service interface="xxx.xxx.xxxService"
                   ref="xxxService" timeout="10000" retries="3"
                   executes="100" loadbalance="leastactive"
                   accesslog="logs/access-xxx.log" register="true"
                   owner="jk" group="gp" version="1.0" /&gt;
</code></pre></div>
<ol start="2" dir="auto">
<li>Launching the program, and accesslog print exactly.</li>
<li>(Upgrade to 2.7.3) Enable metadata-report (I'm not sure whether this affects. Then I tried without metadata-report configuration, and it still not works.), with configuration:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;dubbo:metadata-report address=&quot;zookeeper://zk1.registry.gp.org:2181&quot; cycle-report=&quot;false&quot; sync-report=&quot;true&quot;/&gt;"><pre class="notranslate"><code class="notranslate">&lt;dubbo:metadata-report address="zookeeper://zk1.registry.gp.org:2181" cycle-report="false" sync-report="true"/&gt;
</code></pre></div>
<ol start="4" dir="auto">
<li>Restart the provider-side program, console got log:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2019-11-05 14:55:28  [DUBBO] You specified the config centre, but there's not even one single config item in it., dubbo version: 2.7.3, current host: 192.168.10.***
2019-11-05 14:55:28  [DUBBO] You specified the config centre, but there's not even one single config item in it., dubbo version: 2.7.3, current host: 192.168.10.***
2019-11-05 14:55:28  [DUBBO] There's no valid monitor config found, if you want to open monitor statistics for Dubbo, please make sure your monitor is configured properly., dubbo version: 2.7.3, current host: 192.168.10.***"><pre class="notranslate"><code class="notranslate">2019-11-05 14:55:28  [DUBBO] You specified the config centre, but there's not even one single config item in it., dubbo version: 2.7.3, current host: 192.168.10.***
2019-11-05 14:55:28  [DUBBO] You specified the config centre, but there's not even one single config item in it., dubbo version: 2.7.3, current host: 192.168.10.***
2019-11-05 14:55:28  [DUBBO] There's no valid monitor config found, if you want to open monitor statistics for Dubbo, please make sure your monitor is configured properly., dubbo version: 2.7.3, current host: 192.168.10.***
</code></pre></div>
<p dir="auto">and the accesslog file, which specified with path <code class="notranslate">logs/access-xxx.log</code> does NOT print any access log data.<br>
5. Remove metadata-report configuration, and restart the provider-side program, the same scene appears in step 4.<br>
6. I debugged the code, the AccessLogFilter class in dubbo-2.7.3.jar got an invoker with URL <code class="notranslate">dubbo://192.168.10.xxx:20881/xxx.xxx.xxxService?accesslog=logs/access-xxx.log&amp;anyhost=true&amp;application=platform-xxx-provider&amp;bean.name=xxx.xxx.xxxService&amp;bind.ip=192.168.10.***&amp;bind.port=20881&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;executes=16&amp;generic=false&amp;group=gp&amp;interface=xxx.xxx.xxxService&amp;loadbalance=leastactive&amp;methods=advanced,simple&amp;owner=jk&amp;pid=106617&amp;qos.accept.foreign.ip=false&amp;qos.enable=false&amp;qos.port=33333&amp;register=true&amp;release=2.7.3&amp;retries=3&amp;revision=1.0.0&amp;server=netty&amp;side=provider&amp;timeout=10000&amp;timestamp=1572936930641&amp;version=1.0</code><br>
Here we got a parameter named <code class="notranslate">accesslog</code> in the URL, but the code retrieved <code class="notranslate">dubbo.accesslog</code> key which assigned by static final variable <code class="notranslate">ACCESS_LOG_KEY</code> in this class, and then got <code class="notranslate">null</code> value with accessLogKey variable during the invoke function below:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Override
    public Result invoke(Invoker&lt;?&gt; invoker, Invocation inv) throws RpcException {
        try {
            String accessLogKey = invoker.getUrl().getParameter(ACCESS_LOG_KEY);
            if (ConfigUtils.isNotEmpty(accessLogKey)) {
                AccessLogData logData = buildAccessLogData(invoker, inv);
                log(accessLogKey, logData);
            }
        } catch (Throwable t) {
            logger.warn(&quot;Exception in AccessLogFilter of service(&quot; + invoker + &quot; -&gt; &quot; + inv + &quot;)&quot;, t);
        }
        return invoker.invoke(inv);
    }"><pre class="notranslate"><code class="notranslate">@Override
    public Result invoke(Invoker&lt;?&gt; invoker, Invocation inv) throws RpcException {
        try {
            String accessLogKey = invoker.getUrl().getParameter(ACCESS_LOG_KEY);
            if (ConfigUtils.isNotEmpty(accessLogKey)) {
                AccessLogData logData = buildAccessLogData(invoker, inv);
                log(accessLogKey, logData);
            }
        } catch (Throwable t) {
            logger.warn("Exception in AccessLogFilter of service(" + invoker + " -&gt; " + inv + ")", t);
        }
        return invoker.invoke(inv);
    }
</code></pre></div>
<p dir="auto">AND, I also tried the source code with dubbo-2.6.5 (maven groupId: com.alibaba), and got different Java implementation source bellow (Notice that, the <code class="notranslate">Constants.ACCESS_LOG_KEY</code> has value <code class="notranslate">accesslog</code> assigned, and same value in 2.7.3 with maven groupId: org.apache.dubbo):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Override
    public Result invoke(Invoker&lt;?&gt; invoker, Invocation inv) throws RpcException {
        try {
            String accesslog = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY);
            if (ConfigUtils.isNotEmpty(accesslog)) {
                RpcContext context = RpcContext.getContext();
                String serviceName = invoker.getInterface().getName();
                String version = invoker.getUrl().getParameter(Constants.VERSION_KEY);
                String group = invoker.getUrl().getParameter(Constants.GROUP_KEY);
   ..."><pre class="notranslate"><code class="notranslate">@Override
    public Result invoke(Invoker&lt;?&gt; invoker, Invocation inv) throws RpcException {
        try {
            String accesslog = invoker.getUrl().getParameter(Constants.ACCESS_LOG_KEY);
            if (ConfigUtils.isNotEmpty(accesslog)) {
                RpcContext context = RpcContext.getContext();
                String serviceName = invoker.getInterface().getName();
                String version = invoker.getUrl().getParameter(Constants.VERSION_KEY);
                String group = invoker.getUrl().getParameter(Constants.GROUP_KEY);
   ...
</code></pre></div>
<h4 dir="auto"></h4>
<p dir="auto">BTW: The <a href="https://github.com/apache/dubbo/issues/4374" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/4374/hovercard">bugfix 4374</a> shows that this was fixed, but not specified the fixed version.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Those accesslog configurations should also work, or some other ways to meet the accesslog needs.<br>
BTW: It seems that the AccessLogFilter.ACCESS_LOG_KEY used correctly, and value assigned correctly here. Since it works before metadata-report configured. But when metadata-report configured, it does not work. Is the URL value generated correctly?</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">I have read the <a href="http://dubbo.apache.org/en-us/docs/user/demos/accesslog.html" rel="nofollow">documents of accesslog</a>, but neither the <code class="notranslate">Logging by logging framework</code> part nor the <code class="notranslate">Logging by specified file path</code> part works.</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="NO EXCEPTION. CONFIGURATION NOT WORK."><pre class="notranslate"><code class="notranslate">NO EXCEPTION. CONFIGURATION NOT WORK.
</code></pre></div>