diff --git a/src/com/git/ifly6/communique/ngui/Communique.java b/src/com/git/ifly6/communique/ngui/Communique.java index 54f5079..ffe978c 100644 --- a/src/com/git/ifly6/communique/ngui/Communique.java +++ b/src/com/git/ifly6/communique/ngui/Communique.java @@ -168,11 +168,15 @@ else if (CommuniqueUtils.IS_OS_MAC) { // Make sure we can also log to file, apply this to the root logger try { + // must avoid colons in file names because windows doesn't like it apparently + String timeString = DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.systemDefault()) + .format(Instant.now()) + .replace(':', '-'); // this is the cheapest way to fix this problem + Path logFile = appSupport .resolve("log") - .resolve(String.format("communique-session-%s.log", - DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.systemDefault()) - .format(Instant.now()))); + .resolve(String.format("communique-session-%s.log", timeString)); + Files.createDirectories(logFile.getParent()); // make directory loggerFileHandler = new FileHandler(logFile.toString()); loggerFileHandler.setFormatter(new SimpleFormatter());