Fix API logger configuration (handle invalid or missing config valeus properly).
This commit is contained in:
parent
0ce1581a87
commit
6380c73421
@ -64,18 +64,10 @@ export default class App extends Vue {
|
|||||||
this.consoleLogAppender.threshold = commonLevel;
|
this.consoleLogAppender.threshold = commonLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
const batchSize = parseInt(process.env.VUE_APP_API_LOG_BATCH_SIZE, 10);
|
||||||
this.apiLogAppender.batchSize =
|
if (!isNaN(batchSize)) { this.apiLogAppender.batchSize = Math.max(batchSize, 1); }
|
||||||
parseInt(process.env.VUE_APP_API_LOG_BATCH_SIZE, 10);
|
|
||||||
} catch {
|
|
||||||
this.apiLogAppender.batchSize = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
const minTimeInSec = parseInt(process.env.VUE_APP_API_LOG_MIN_TIME_PASSED_IN_SEC, 10);
|
||||||
this.apiLogAppender.minimumTimePassedInSec
|
if (!isNaN(minTimeInSec)) { this.apiLogAppender.minimumTimePassedInSec = Math.max(minTimeInSec, 1); }
|
||||||
= parseInt(process.env.VUE_APP_API_LOG_MIN_TIME_PASSED_IN_SEC, 10);
|
|
||||||
} catch {
|
|
||||||
this.apiLogAppender.minimumTimePassedInSec = 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user