Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spring-projects/spring-boot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: geminiKim/spring-boot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix-logback-spring-property
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on May 29, 2023

  1. Copy the full SHA
    0fec4db View commit details
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

package org.springframework.boot.logging.logback;

import ch.qos.logback.core.joran.action.ActionUtil;
import ch.qos.logback.core.joran.action.BaseModelAction;
import ch.qos.logback.core.joran.spi.SaxEventInterpretationContext;
import ch.qos.logback.core.model.Model;
@@ -46,6 +47,10 @@ protected Model buildCurrentModel(SaxEventInterpretationContext interpretationCo
model.setSource(attributes.getValue(SOURCE_ATTRIBUTE));
model.setScope(attributes.getValue(SCOPE_ATTRIBUTE));
model.setDefaultValue(attributes.getValue(DEFAULT_VALUE_ATTRIBUTE));

if (ActionUtil.stringToScope(model.getScope()) == ActionUtil.Scope.CONTEXT) {
interpretationContext.getContext().putProperty(model.getName(), model.getSourceOrDefaultValue());
}
return model;
}

Original file line number Diff line number Diff line change
@@ -58,4 +58,11 @@ void setSource(String source) {
this.source = source;
}

String getSourceOrDefaultValue() {
if (this.source == null) {
return this.defaultValue;
}
return this.source;
}

}