changed logger file name due to incompatibility to windows

This commit is contained in:
Sven Vogel 2023-07-16 00:27:03 +02:00
parent ad279a6b15
commit 7ee3f5e040
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public final class Logging {
private static void createFileLogger(Level level) { private static void createFileLogger(Level level) {
var now = LocalDateTime.now(); var now = LocalDateTime.now();
var dateTime = DateTimeFormatter.ISO_DATE_TIME.format(now); var dateTime = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss").format(now);
var logFileName = LOG_FOLDER_NAME + dateTime + ".log"; var logFileName = LOG_FOLDER_NAME + dateTime + ".log";
initializeLogFolder(); initializeLogFolder();
@ -43,7 +43,7 @@ public final class Logging {
var fh = new FileHandler(logFileName); var fh = new FileHandler(logFileName);
fh.setLevel(level); fh.setLevel(level);
LOGGER.addHandler(fh); LOGGER.addHandler(fh);
} catch (IOException e) { } catch (Exception e) {
LOGGER.warning("Unable to initialize logging for file: " + logFileName); LOGGER.warning("Unable to initialize logging for file: " + logFileName);
} }
} }