Replace the Logback condition attribute with the condition element

MSAL

Logback 1.5.37 removed the Janino based <if condition="..."> attribute that 1.5.20 deprecated, so configuration files still using it fail to select the intended appenders. Replaces the attribute with the <condition class="..."/> element that precedes <if>, using the conditions shipped in ch.qos.logback.core.boolex. Conditions that require custom Java logic are left unchanged and reported in a data table.

org.openrewrite.java.logging.logback.ConditionAttributeToConditionElement

Optional

A glob expression that can be used to constrain which directories or source files should be searched. Multiple patterns may be specified, separated by a semicolon ;. If multiple patterns are supplied any of the patterns matching will be interpreted as a match. When not set, **/logback*.xml is used.

mod run . --recipe=org.openrewrite.java.logging.logback.ConditionAttributeToConditionElement

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.