Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix toolkit-common-logging config bug #1178

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {

@Override
public int getOrder() {
// Must be invoked after ConfigFileApplicationListener
return Ordered.HIGHEST_PRECEDENCE + 20;
// Must be invoked after ConfigFileApplicationListener, and before SofaConfigSourceSupportListener
return Ordered.HIGHEST_PRECEDENCE + 12;
}

private void prepare(ConfigurableEnvironment environment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.alipay.sofa.common.config.SofaConfigs;
import com.alipay.sofa.common.config.source.AbstractConfigSource;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.context.logging.LoggingApplicationListener;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
Expand All @@ -33,7 +34,7 @@ public class SofaConfigSourceSupportListener
implements
ApplicationListener<ApplicationEnvironmentPreparedEvent>,
Ordered {
private static final int SOFA_BOOT_CONFIG_SOURCE_ORDER = LOWEST_PRECEDENCE;
private static final int SOFA_BOOT_CONFIG_SOURCE_ORDER = LoggingApplicationListener.DEFAULT_ORDER - 5;

@Override
public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
Expand Down Expand Up @@ -63,6 +64,6 @@ public boolean hasKey(String key) {

@Override
public int getOrder() {
return LOWEST_PRECEDENCE;
return LoggingApplicationListener.DEFAULT_ORDER - 5;
}
}