void () { Path logDirectory = BuildManager.getBuildLogDirectory().toPath(); try { NioFiles.deleteRecursively(logDirectory); Files.createDirectories(logDirectory); } catch (IOException e) { throw new RuntimeException(e); } Properties properties = new Properties(); try { try (InputStream config = LogSetup.readDefaultLogConfig()) { properties.load(config); } properties.setProperty("log4j.rootLogger", "debug, file"); Path logFile = logDirectory.resolve(LogSetup.LOG_CONFIG_FILE_NAME); try (OutputStream output = new BufferedOutputStream(Files.newOutputStream(logFile))) { properties.store(output, null); } } catch (IOException e) { throw new RuntimeException(e); } }