Repository navigation
Commit fe50bb5
fix: do not warn when both converterClass and class attributes are specified (Issue #1031)
When both 'converterClass' (deprecated) and 'class' (replacement) attributes
are specified in a <conversionRule> configuration element, the behavior should be:
1. Silently use the 'class' attribute value (no deprecation warning needed)
2. Log info messages instead of warnings about the duplicate attributes
3. Maintain backward compatibility - allows older config files with only
'converterClass' to work on newer versions without unnecessary warnings
This fixes the issue where legitimate configuration that provides both
attributes for compatibility across versions would generate spurious
deprecation warnings.
Changes:
- Modified ConversionRuleAction.validPreconditions() to NOT warn about
'converterClass' when 'class' is also present
- Changed duplicate attribute warning to info-level logging instead
- Added test case testConversionRuleWithBothAttributes to verify behavior
- Added test XML configuration file for the new test case
Fixes #1031
Signed-off-by: lukman48 <lukman_uki@yahoo.co.id>1 parent f8fc692 commit fe50bb5
3 files changed
Lines changed: 41 additions & 4 deletions
File tree
- logback-classic/src/test
- input/joran/conversionRule
- java/ch/qos/logback/classic
- logback-core/src/main/java/ch/qos/logback/core/joran/action
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
287 | 302 | | |
288 | 303 | | |
289 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | | - | |
52 | 56 | | |
53 | | - | |
54 | | - | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
0 commit comments