CCCLL opened a new pull request, #16529:
URL: https://github.com/apache/dubbo/pull/16529

   ## What is the purpose of the change?
   
   Fixes #16528.
   
   `AccessLogFilter` logs a 0-28 warning on every flush when `accesslog` points 
to a file:
   
   - With `accesslog.fixed.path` left at its default (`true`), the entries go 
to the default logger and the warning contained leftover `" +` fragments and 
line breaks of a string concatenation that had ended up inside the literal. It 
also asked users to set `accesslog.fixed.path=true` to use the file, although 
the file is only used when the key is `false` (see #12546).
   - With `accesslog.fixed.path=false`, the warning passed its text as the 
`cause` argument and `""` as the message, so the log line started with `[DUBBO] 
,`.
   
   This PR turns the first warning into one sentence that names 
`accesslog.fixed.path=false`, and passes the second text as the message, with 
an empty cause like most other warnings in the code base.
   
   ## Behavior change
   
   - Only the text of the two 0-28 warnings changes. Where the access log 
entries are written, when the warnings are logged and the error code stay the 
same.
   
   ## Verification
   
   - `AccessLogFilterTest#testCustom` now also checks the full message of both 
warnings. Each new assertion fails before the change (`expected: <1> but was: 
<0>`) and passes after it.
   - `mvn verify -pl dubbo-rpc/dubbo-rpc-api`: 155 tests, 0 failures (1 
skipped, `GenericImplFilterTest`); spotless and checkstyle are clean.
   - End to end, a provider with `accesslog` set to a file and a consumer in 
one JVM, before and after the change:
   
   | `accesslog.fixed.path` | where the entries go | warning before | warning 
after |
   |---|---|---|---|
   | not set | default logger | `" +` fragments over four lines, says `=true` | 
one line, says `=false` |
   | `false` (application parameter) | the file | `[DUBBO] , dubbo version: 
...` | `[DUBBO] Accesslog file path changed to <file>, ...` |
   
   ## Checklist
   - [x] Make sure there is a 
[GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
   - [x] Write a pull request description that is detailed enough to understand 
what the pull request does, how, and why.
   - [x] Write necessary unit-test to verify your logic correction. If the new 
feature or significant change is committed, please remember to add sample in 
[dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [ ] Make sure gitHub actions can pass. [Why the workflow is failing and 
how to fix it?](../CONTRIBUTING.md)
   


-- 
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]

Reply via email to