You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "jicro (GitHub)" <gi...@apache.org> on 2019/11/05 07:54:17 UTC

[GitHub] [dubbo] jicro opened issue #5281: Accesslog Configuration does NOT work, while metadata-report configured.

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.3
* Operating System version: CentOS Linux release 7.3.1611 (Core)
* Java version: Oracle JDK 1.8

### Steps to reproduce this issue

1. Provider-side program with ```provider.xml``` (Spring-Context-Configuration), which without ```metadata-report``` configuration. And accesslog enabled:
```
<dubbo:protocol name="dubbo" port="21882" server="netty" register="true" accesslog="logs/access.log"/>
    <!-- 接口的位置 -->
    <dubbo:service interface="xxx.xxx.xxxService"
                   ref="nerService" timeout="60000" retries="3"
                   executes="100" loadbalance="leastactive"
                   accesslog="logs/access-xxx.log" register="true"
                   owner="jk" group="gp" version="1.0" />
```
2. Launching the program, and accesslog print exactly.
3. Enable metadata-report, with configuration:
```
<dubbo:metadata-report address="zookeeper://zk1.registry.gp.org:2181" cycle-report="false" sync-report="true"/>
```
4. Restart the provider-side program, console got log:
```
[2019-11-05 15:30: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.***
```
and the accesslog file, which specified with path ```logs/access-xxx.log``` does NOT print any access log data.
5. Remove metadata-report configuration, and restart the provider-side program, the same scene appears in step 4.

####
BTW: The [bugfix 4374](https://github.com/apache/dubbo/issues/4374) shows that this was fixed, but not specified the fixed version.

### Expected Result

Those accesslog configurations should also work, or some other ways to meet the accesslog needs.

### Actual Result

I have read the [documents of accesslog](http://dubbo.apache.org/en-us/docs/user/demos/accesslog.html), but neither the ```Logging by logging framework``` part nor the ```Logging by specified file path``` part works.


If there is an exception, please attach the exception trace:

```
NO EXCEPTION. CONFIGURATION NOT WORK.
```


[ Full content available at: https://github.com/apache/dubbo/issues/5281 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] chickenlj closed issue #5281: Accesslog Configuration does NOT work, while metadata-report configured.

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ issue closed by chickenlj ]

[ Full content available at: https://github.com/apache/dubbo/issues/5281 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] jicro commented on issue #5281: Accesslog Configuration does NOT work, while metadata-report configured.

Posted by "jicro (GitHub)" <gi...@apache.org>.
> > (4)远程DEBUG了一波,发现2.7.3里面的AccessLogFilter会从invoker的URL中取参数项“dubbo.accesslog”(通过变量AccessLogFilter.ACCESS_LOG_KEY),但是URL中根本不存在这个项,对应在URL中存在的是“accesslog”配置项。
> > 调试2.6.5版本的代码发现是通过“accesslog”(通过变量Constants.ACCESS_LOG_KEY)的配置项获取对应的值。
> 
> 在 2.7.3 中 AccessLogFilter 中的 ACCESS_LOG_KEY 定义和 org.apache.dubbo.rpc.Constants.ACCESS_LOG_KEY 存在重复, 导致了以上问题。我发现在 2.7.4.1 中被修复了

非常感谢,经测已经可以正常使用了。

[ Full content available at: https://github.com/apache/dubbo/issues/5281 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org