|
@@ -1,6 +1,5 @@
|
1
|
1
|
package me.yuxiaoyao.config.log;
|
2
|
2
|
|
3
|
|
-import ch.qos.logback.classic.util.ContextInitializer;
|
4
|
3
|
import me.yuxiaoyao.config.loader.ConfigLoader;
|
5
|
4
|
import org.slf4j.bridge.SLF4JBridgeHandler;
|
6
|
5
|
|
|
@@ -23,14 +22,14 @@ public class LogSetter {
|
23
|
22
|
if (profile == null) {
|
24
|
23
|
return;
|
25
|
24
|
}
|
26
|
|
- File file = new File(ConfigLoader.DEFAULT_FILE_CONFIG_FOLDER + File.separator + basename + "-" + profile + "xml");
|
|
25
|
+ File file = new File(ConfigLoader.DEFAULT_FILE_CONFIG_FOLDER + File.separator + basename + "-" + profile + ".xml");
|
27
|
26
|
if (file.exists()) {
|
28
|
|
- System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, file.getAbsolutePath());
|
|
27
|
+ System.setProperty("logback.configurationFile", file.getAbsolutePath());
|
29
|
28
|
return;
|
30
|
29
|
}
|
31
|
|
- file = new File(ConfigLoader.DEFAULT_FILE_CONFIG_FOLDER + File.separator + basename + "xml");
|
|
30
|
+ file = new File(ConfigLoader.DEFAULT_FILE_CONFIG_FOLDER + File.separator + basename + ".xml");
|
32
|
31
|
if (file.exists()) {
|
33
|
|
- System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, file.getAbsolutePath());
|
|
32
|
+ System.setProperty("logback.configurationFile", file.getAbsolutePath());
|
34
|
33
|
}
|
35
|
34
|
}
|
36
|
35
|
}
|