void (@NotNull Path logFilePath, boolean appendToFile, boolean showDateInConsole, boolean enableConsoleLogger, @Nullable Runnable onRotate) { long limit = 10_000_000; String limitProp = System.getProperty("idea.log.limit"); if (limitProp != null) { try { limit = Long.parseLong(limitProp); } catch (NumberFormatException e) { // ignore } } int count = 12; String countProp = System.getProperty("idea.log.count"); if (countProp != null) { try { count = Integer.parseInt(countProp); } catch (NumberFormatException e) { // ignore } } boolean logConsole = Boolean.parseBoolean(System.getProperty("idea.log.console", "true")); java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(""); IdeaLogRecordFormatter layout = new IdeaLogRecordFormatter(); Handler fileHandler = new RollingFileHandler(logFilePath, limit, count, appendToFile, onRotate); fileHandler.setFormatter(layout); fileHandler.setLevel(java.util.logging.Level.FINEST); rootLogger.addHandler(fileHandler); if (enableConsoleLogger && logConsole) { Handler consoleHandler = new OptimizedConsoleHandler(); consoleHandler.setFormatter(new IdeaLogRecordFormatter(showDateInConsole, layout)); consoleHandler.setLevel(java.util.logging.Level.WARNING); rootLogger.addHandler(consoleHandler); } }