-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accesslog Configuration does NOT work, while metadata-report configured. #5281
Comments
简单用中文描述一下踩到的坑(还在坑里没出来.....): (4)远程DEBUG了一波,发现2.7.3里面的AccessLogFilter会从invoker的URL中取参数项“dubbo.accesslog”(通过变量AccessLogFilter.ACCESS_LOG_KEY),但是URL中根本不存在这个项,对应在URL中存在的是“accesslog”配置项。 (5)因此分析,可能是由于升级后的版本代码变更后,对日志这部分进行了调整。通过查阅其它issue发现有说根据官网文档配置的方式。后来参考官方文档的Logging by logging framework小节配置了一波,发现能够创建配置的日志文件,但是不打印访问日志.....另外根据Logging by specified file path小节配置的就是原来的配置方法,不生效(不创建日志文件,也不打印日志)。 顺带建议一下:能否更新一下官网的文档?那文档太迷了....也不知道对应哪个版本。 |
在 2.7.3 中 AccessLogFilter 中的 ACCESS_LOG_KEY 定义和 org.apache.dubbo.rpc.Constants.ACCESS_LOG_KEY 存在重复, 导致了以上问题。我发现在 2.7.4.1 中被修复了 |
非常感谢,经测 2.7.4.1 版本已经可以正常使用了。 |
Environment
Steps to reproduce this issue
provider.xml
(Spring-Context-Configuration), which withoutmetadata-report
configuration. And accesslog enabled: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.
6. I debugged the code, the AccessLogFilter class in dubbo-2.7.3.jar got an invoker with URL
dubbo://192.168.10.xxx:20881/xxx.xxx.xxxService?accesslog=logs/access-xxx.log&anyhost=true&application=platform-xxx-provider&bean.name=xxx.xxx.xxxService&bind.ip=192.168.10.***&bind.port=20881&deprecated=false&dubbo=2.0.2&dynamic=true&executes=16&generic=false&group=gp&interface=xxx.xxx.xxxService&loadbalance=leastactive&methods=advanced,simple&owner=jk&pid=106617&qos.accept.foreign.ip=false&qos.enable=false&qos.port=33333®ister=true&release=2.7.3&retries=3&revision=1.0.0&server=netty&side=provider&timeout=10000×tamp=1572936930641&version=1.0
Here we got a parameter named
accesslog
in the URL, but the code retrieveddubbo.accesslog
key which assigned by static final variableACCESS_LOG_KEY
in this class, and then gotnull
value with accessLogKey variable during the invoke function below: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
Constants.ACCESS_LOG_KEY
has valueaccesslog
assigned, and same value in 2.7.3 with maven groupId: org.apache.dubbo):BTW: The bugfix 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.
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?
Actual Result
I have read the documents of accesslog, but neither the
Logging by logging framework
part nor theLogging by specified file path
part works.If there is an exception, please attach the exception trace:
The text was updated successfully, but these errors were encountered: