File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
server/src/main/java/sc/server Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 12
12
13
13
public final class Application {
14
14
15
- private static final Logger logger = LoggerFactory .getLogger (Application .class );
16
- private static final Object SYNCOBJ = new Object ();
17
-
18
15
static {
19
- String config = System .getProperty ("logback.configurationFile" );
20
- logger .debug ("Loading logback config from {}" , config != null ? config : System .getProperty ("user.dir" ) + File .separator + "logback.xml" );
21
- if (config == null )
22
- System .setProperty ("logback.configurationFile" , System .getProperty ("user.dir" ) + File .separator + "logback.xml" );
23
- System .setProperty ("file.encoding" , "UTF-8" );
16
+ LoggingKt .logbackFromPWD ();
24
17
}
25
18
19
+ private static final Logger logger = LoggerFactory .getLogger (Application .class );
20
+ private static final Object SYNCOBJ = new Object ();
21
+
26
22
public static void main (String [] params ) {
27
23
// setup server
28
24
try {
Original file line number Diff line number Diff line change
1
+ package sc.server
2
+
3
+ import ch.qos.logback.classic.util.ContextInitializer
4
+ import java.io.File
5
+
6
+ fun logbackFromPWD () {
7
+ System .setProperty(" file.encoding" , " UTF-8" )
8
+ var config = System .getProperty(ContextInitializer .CONFIG_FILE_PROPERTY )
9
+ if (config == null ) {
10
+ config = System .getProperty(" user.dir" ) + File .separator + " logback.xml"
11
+ System .setProperty(ContextInitializer .CONFIG_FILE_PROPERTY , config)
12
+ }
13
+ // println("Loading logback config from $config")
14
+ }
You can’t perform that action at this time.
0 commit comments