CCCLL opened a new issue, #16528:
URL: https://github.com/apache/dubbo/issues/16528
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
`3.3` branch (cb05763298), OpenJDK 21, macOS. The warning texts were added
in #11094 and are in every release since 3.2.0.
### Steps to reproduce this issue
A provider whose service sets `accesslog` to a file
(`ServiceConfig#setAccesslog("<file>")`), called a few times by a consumer.
**1. `accesslog.fixed.path` not set (default `true`).** The entries go to
the `dubbo.accesslog.<interface>` logger instead of the file, and every flush
logs:
```
WARN org.apache.dubbo.rpc.filter.AccessLogFilter - [DUBBO] Will write to
the default location, " +
"please enable this feature by setting
'accesslog.fixed.path=true' and restart the process. " +
"We highly recommend to not enable this feature in
production for security concerns, " +
"please be fully aware of the potential risks before
doing so!, dubbo version: 3.3.7-SNAPSHOT, current host: <host>, error code:
0-28. This may be caused by Change of accesslog file path not allowed. , go to
https://dubbo.apache.org/faq/0/28 to find instructions.
```
- The `" +` fragments and the line breaks come from a string concatenation
that ended up inside the string literal (`AccessLogFilter.java`, the
`isFixedPath` branch of `writeLogSetToFile`).
- It asks for `accesslog.fixed.path=true`, which is the default that causes
this warning. The file is only used with `accesslog.fixed.path=false`
(`invoker.getUrl().getParameter(ACCESS_LOG_FIXED_PATH_KEY, true)`), as also
explained in #12546.
**2. `accesslog.fixed.path=false`** (set through the application parameters,
as described in #12546). The entries are written to the file, and the warning
has an empty message, because the text is passed as the `cause` argument and
`""` as the message:
```
WARN org.apache.dubbo.rpc.filter.AccessLogFilter - [DUBBO] , dubbo version:
3.3.7-SNAPSHOT, current host: <host>, error code: 0-28. This may be caused by
Accesslog file path changed to <file>, be aware of possible vulnerabilities!,
go to https://dubbo.apache.org/faq/0/28 to find instructions.
```
### What you expected to happen
1. One sentence that names the value that actually enables the file:
```
[DUBBO] Will write to the default location, please enable this feature by
setting 'accesslog.fixed.path=false' and restart the process. We highly
recommend to not enable this feature in production for security concerns,
please be fully aware of the potential risks before doing so!, dubbo version:
...
```
2. The path change as the message:
```
[DUBBO] Accesslog file path changed to <file>, be aware of possible
vulnerabilities!, dubbo version: ...
```
### Anything else
Only the log text is wrong; where the entries are written is correct in both
cases.
The FAQ page for 0-28 on the website (`reference-manual/faq/0/28.md` in
apache/dubbo-website) also describes `accesslog.fixed.path=true` as the switch
that allows changing the path. That page is not part of this repository.
### Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]