Skip to content

Commit b50229c

Browse files
Egor18monperrus
authored andcommittedMay 27, 2019
fix: support configurable log file (#2993)
1 parent 0bc041c commit b50229c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎src/main/java/spoon/Launcher.java

+5
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ public void printUsage() {
130130
}
131131

132132
static {
133+
// Initialize log output path with the default value
134+
if (System.getProperty("spoon.log.path") == null) {
135+
System.setProperty("spoon.log.path", "${java.io.tmpdir}/spoon-log.log");
136+
}
137+
133138
jsapSpec = defineArgs();
134139
}
135140

‎src/main/resources/log4j.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
77
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %p %c - %m%n
88

99
log4j.appender.R=org.apache.log4j.RollingFileAppender
10-
log4j.appender.R.File=${java.io.tmpdir}/spoon-log.log
10+
log4j.appender.R.File=${spoon.log.path}
1111

1212
log4j.appender.R.MaxFileSize=1000KB
1313
log4j.appender.R.MaxBackupIndex=3

0 commit comments

Comments
 (0)
Please sign in to comment.