Commit 60261b0
authored
chore: fix ProxyChannelStateMachine logging policy compliance (kroxylicious#3752)
* Fix ProxyChannelStateMachine logging policy compliance
All log statements now include sessionId and virtualCluster as
structured key-values, enabling operators to correlate log events
to a specific session and cluster. Separate remoteHost/remotePort
and clientHost/clientPort keys are replaced with combined address
and clientAddress keys per policy.
Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
* ensure the mock handler behaves
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
# Conflicts:
# kroxylicious-runtime/src/test/java/io/kroxylicious/proxy/internal/ProxyChannelStateMachineTest.java
* Extract sessionId and virtualCluster log key constants
Avoids duplicating the string literals across every log call in the class.
Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
* Revert "Extract sessionId and virtualCluster log key constants"
This reverts commit fe33af2.
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
* Extract log(Level) helper to PSCM to reduce per-call boilerplate
Adds a private log(Level) method that pre-populates sessionId and
virtualCluster on the LoggingEventBuilder before returning it to the
call site, mirroring the pattern already used by FilterHandler.
Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
* Use Supplier form of addKeyValue for lazily-evaluated address keys
Avoids string construction when DEBUG/INFO logging is disabled.
Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
* Extract local variable to avoid requireNonNull inside logging supplier
Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
---------
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>1 parent 9079f82 commit 60261b0
2 files changed
Lines changed: 29 additions & 13 deletions
File tree
- kroxylicious-runtime/src
- main/java/io/kroxylicious/proxy/internal
- test/java/io/kroxylicious/proxy/internal
Lines changed: 27 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| 229 | + | |
| 230 | + | |
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
| |||
332 | 336 | | |
333 | 337 | | |
334 | 338 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 339 | + | |
| 340 | + | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| |||
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
496 | 498 | | |
497 | 499 | | |
498 | 500 | | |
499 | | - | |
| 501 | + | |
500 | 502 | | |
501 | 503 | | |
502 | 504 | | |
| |||
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
525 | | - | |
| 527 | + | |
526 | 528 | | |
527 | 529 | | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
533 | | - | |
| 535 | + | |
534 | 536 | | |
535 | 537 | | |
536 | 538 | | |
| |||
632 | 634 | | |
633 | 635 | | |
634 | 636 | | |
635 | | - | |
636 | | - | |
| 637 | + | |
| 638 | + | |
637 | 639 | | |
638 | | - | |
639 | | - | |
| 640 | + | |
640 | 641 | | |
641 | 642 | | |
642 | 643 | | |
| |||
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
746 | | - | |
| 747 | + | |
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
753 | 767 | | |
754 | 768 | | |
755 | 769 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
0 commit comments