Java Code Examples for java.util.logging.FileHandler#setFormatter()

The following examples show how to use java.util.logging.FileHandler#setFormatter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PMController.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Enables/disables PM log file. By default, the log file is disabled.
 * 
 * @param enable
 *          if <code>true</code>, the log file is enabled, otherwise it is disabled.
 */
public static void setLogFileEnabled(boolean enable) {
  if (enable) {
    Handler[] handlers = getLogger().getHandlers();
    if (handlers == null || handlers.length == 0) {
      // add default file handler
      try {
        FileHandler fileHandler = new FileHandler(LOG_FILE, false);
        fileHandler.setLevel(Level.ALL);
        fileHandler.setFormatter(new PMLogFormatter());
        getLogger().addHandler(fileHandler);
      } catch (Throwable err) {
        System.err.println("Error initializing log file " + PMController.class.getName() + ": "
                + err.toString());
      }
    }
  }
  __logFileEnabled = enable;
}
 
Example 2
Source File: QueryEventListener.java    From emr-presto-query-event-listener with Apache License 2.0 6 votes vote down vote up
public void createLogFile()
{

    SimpleDateFormat dateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    String timeStamp = dateTime.format(new Date());
    StringBuilder logPath = new StringBuilder();

    logPath.append("/var/log/presto/queries-");
    logPath.append(timeStamp);
    logPath.append(".%g.log");

    try {
        logger = Logger.getLogger(loggerName);
        fh = new FileHandler(logPath.toString(), 524288000, 5, true);
        logger.addHandler(fh);
        logger.setUseParentHandlers(false);
        SimpleFormatter formatter = new SimpleFormatter();
        fh.setFormatter(formatter);
    }
    catch (IOException e) {
        logger.info(e.getMessage());
    }
}
 
Example 3
Source File: TestClass.java    From OCA-Java-SE-7-Programmer-I with MIT License 6 votes vote down vote up
public static void main(String[] args) throws IOException {

        /* Ensure directory has been created */
        new File("logs").mkdir();

        /* Get the date to be used in the filename */
        DateFormat df = new SimpleDateFormat("yyyyMMddhhmmss");
        Date now = new Date();
        String date = df.format(now);

        /* Set up the filename in the logs directory */
        String logFileName = "logs/testlog-" + date + ".txt";

        /* Set up logger */
        FileHandler myFileHandler = new FileHandler(logFileName);
        myFileHandler.setFormatter(new SimpleFormatter());
        Logger ocajLogger = Logger.getLogger("OCAJ Logger");
        ocajLogger.setLevel(Level.ALL);
        ocajLogger.addHandler(myFileHandler);

        /* Log Message */
        ocajLogger.info("\nThis is a logged information message.");

        /* Close the file */
        myFileHandler.close();
    }
 
Example 4
Source File: CommandHandler.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @return prepared JULs logger.
 */
private Logger setupJavaLogger() {
    Logger result = initLogger(CommandHandler.class.getName() + "Log");

    // Adding logging to file.
    try {
        String absPathPattern = new File(JavaLoggerFileHandler.logDirectory(U.defaultWorkDirectory()), "control-utility-%g.log").getAbsolutePath();

        FileHandler fileHandler = new FileHandler(absPathPattern, 5 * 1024 * 1024, 5);

        fileHandler.setFormatter(new JavaLoggerFormatter());

        result.addHandler(fileHandler);
    }
    catch (Exception e) {
        System.out.println("Failed to configure logging to file");
    }

    // Adding logging to console.
    result.addHandler(setupStreamHandler());

    return result;
}
 
Example 5
Source File: IncrementalActionGraphIntegrationTest.java    From buck with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws IOException {
  incrementalActionGraphGeneratorLogger = Logger.get(IncrementalActionGraphGenerator.class);
  incrementalActionGraphGeneratorLogger.setLevel(Level.FINER);
  Path fullLogFilePath = tmp.getRoot().resolve(getLogFilePath());
  Files.createDirectories(fullLogFilePath.getParent());
  FileHandler handler = new FileHandler(fullLogFilePath.toString());
  handler.setFormatter(new LogFormatter());
  incrementalActionGraphGeneratorLogger.addHandler(handler);

  workspace =
      TestDataHelper.createProjectWorkspaceForScenarioWithoutDefaultCell(
          this, "incremental_action_graph", tmp);
  workspace.setUp();
}
 
Example 6
Source File: PGETaskInstance.java    From oodt with Apache License 2.0 5 votes vote down vote up
protected java.util.logging.Logger createLogger() throws IOException, PGEException {
   File logDir = new File(pgeConfig.getExeDir(), "logs");
   if (!(logDir.exists() || logDir.mkdirs())) {
      throw new PGEException("mkdirs for logs directory return false");
   }

   java.util.logging.Logger logger = java.util.logging.Logger.getLogger(PGETaskInstance.class.getName() + "." + workflowInstId);
   // TODO Need to find an alternative way to add a dynamic handler to write workflowInstance logs to a separate file
   FileHandler handler = new FileHandler(new File(logDir, createLogFileName()).getAbsolutePath());
   handler.setEncoding("UTF-8");
   handler.setFormatter(new SimpleFormatter());
   logger.addHandler(handler);
   return logger;
}
 
Example 7
Source File: DiffRuleKeysScriptIntegrationTest.java    From buck with Apache License 2.0 5 votes vote down vote up
@Before
public void enableVerboseRuleKeys() throws Exception {
  lastPositionInLog = 0;
  ruleKeyBuilderLogger = Logger.get(RuleKeyBuilder.class);
  previousRuleKeyBuilderLevel = ruleKeyBuilderLogger.getLevel();
  ruleKeyBuilderLogger.setLevel(Level.FINER);
  Path fullLogFilePath = tmp.getRoot().resolve(getLogFilePath());
  Files.createDirectories(fullLogFilePath.getParent());
  FileHandler handler = new FileHandler(fullLogFilePath.toString());
  handler.setFormatter(new LogFormatter());
  ruleKeyBuilderLogger.addHandler(handler);
}
 
Example 8
Source File: ResourceUsageAnalyzer.java    From bazel with Apache License 2.0 5 votes vote down vote up
public ResourceUsageAnalyzer(
    Set<String> resourcePackages,
    @NonNull Path rTxt,
    @NonNull Path classes,
    @NonNull Path manifest,
    @Nullable Path mapping,
    @NonNull Path resources,
    @Nullable Path logFile)
    throws DOMException, ParserConfigurationException {
  this.model = new ResourceShrinkerUsageModel();
  this.resourcePackages = resourcePackages;
  this.rTxt = rTxt;
  this.proguardMapping = mapping;
  this.classes = classes;
  this.mergedManifest = manifest;
  this.mergedResourceDir = resources;

  this.logger = Logger.getLogger(getClass().getName());
  logger.setLevel(Level.FINE);
  if (logFile != null) {
    try {
      FileHandler fileHandler = new FileHandler(logFile.toString());
      fileHandler.setLevel(Level.FINE);
      fileHandler.setFormatter(
          new Formatter() {
            @Override
            public String format(LogRecord record) {
              return record.getMessage() + "\n";
            }
          });
      logger.addHandler(fileHandler);
    } catch (SecurityException | IOException e) {
      logger.warning(String.format("Unable to open '%s' to write log.", logFile));
    }
  }
}
 
Example 9
Source File: AbstractLauncher.java    From fxlauncher with Apache License 2.0 5 votes vote down vote up
/**
 * Make java.util.logger log to a file. Default it will log to $TMPDIR/fxlauncher.log. This can be overriden by using
 * comman line parameter <code>--logfile=logfile</code>
 *
 * @throws IOException
 */
protected void setupLogFile() throws IOException {
    String filename = System.getProperty("java.io.tmpdir") + File.separator + "fxlauncher.log";
    if (getParameters().getNamed().containsKey("logfile"))
        filename = getParameters().getNamed().get("logfile");
    System.out.println("logging to " + filename);
    FileHandler handler = new FileHandler(filename);
    handler.setFormatter(new SimpleFormatter());
    log.addHandler(handler);
}
 
Example 10
Source File: LogConfigurator.java    From greenbeans with Apache License 2.0 5 votes vote down vote up
private void configureFileLogger(File directory) {
	File logLocation = logLocation(directory);
	if (!logLocation.exists()) {
		logLocation.mkdirs();
	}
	try {
		FileHandler handler = new FileHandler(pathPattern(logLocation), LIMIT, COUNT, true);
		handler.setFormatter(fileFormatter());
		logger.addHandler(handler);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 11
Source File: TestRequestResponseLogging.java    From gitlab4j-api with MIT License 5 votes vote down vote up
@BeforeClass
public static void setup() throws Exception {

    String problems = "";

    if (TEST_HOST_URL == null || TEST_HOST_URL.trim().isEmpty()) {
        problems += "TEST_HOST_URL cannot be empty\n";
    }

    if (TEST_PRIVATE_TOKEN == null || TEST_PRIVATE_TOKEN.trim().isEmpty()) {
        problems += "TEST_PRIVATE_TOKEN cannot be empty\n";
    }

    if (problems.isEmpty()) {

        tempLoggingFile = tempFolder.newFile("test-loging.log");

        loggingHandler = new FileHandler(tempLoggingFile.getAbsolutePath());
        loggingHandler.setFormatter(new SimpleFormatter());
        logger = Logger.getLogger(TestRequestResponseLogging.class.getName());
        logger.setUseParentHandlers(false);
        logger.addHandler(loggingHandler);
        loggingHandler.setLevel(Level.ALL);
        logger.setLevel(Level.ALL);

        gitLabApiWithEntityLogging = new GitLabApi(TEST_HOST_URL, TEST_PRIVATE_TOKEN);
        gitLabApiWithEntityLogging.enableRequestResponseLogging(logger, Level.INFO, 100);
        gitLabApiNoEntityLogging = new GitLabApi(TEST_HOST_URL, TEST_PRIVATE_TOKEN);
        gitLabApiNoEntityLogging.enableRequestResponseLogging(logger, Level.INFO);
        gitLabApiNoMaskingLogging = new GitLabApi(TEST_HOST_URL, TEST_PRIVATE_TOKEN);
        gitLabApiNoMaskingLogging.enableRequestResponseLogging(logger, Level.INFO, 100, new ArrayList<String>());

        gitLabApiWithoutLogging = new GitLabApi(TEST_HOST_URL, TEST_PRIVATE_TOKEN);

    } else {
        System.err.print(problems);
    }
}
 
Example 12
Source File: LogUtils.java    From BetonQuest with GNU General Public License v3.0 5 votes vote down vote up
private static void setupLoggerHandler()
        throws SecurityException, IOException {
    fileHandler = new FileHandler(LOG_FILE.getAbsolutePath());
    getLogger().addHandler(fileHandler);
    fileHandler.setFormatter(new LogFormatter());
    fileHandler.setFilter(getLogFilter());
}
 
Example 13
Source File: LogsManager.java    From RepoSense with MIT License 5 votes vote down vote up
/**
 * Creates a {@code FileHandler} for the log file.
 *
 * @throws IOException if there are problems opening the file.
 */
private static FileHandler createFileHandler() throws IOException {
    Path path = logFolderLocation.resolve(LOG_FOLDER_NAME).resolve(LOG_FILE_NAME);
    FileHandler fileHandler = new FileHandler(path.toString(), MAX_FILE_SIZE_IN_BYTES, FILE_COUNT, true);
    fileHandler.setFormatter(new SimpleFormatter());
    fileHandler.setLevel(currentFileLogLevel);
    return fileHandler;
}
 
Example 14
Source File: Log.java    From MobyDroid with Apache License 2.0 5 votes vote down vote up
public static void init() {
    try {
        // Create an appending file handler
        // Create a file handler that write log record to a file
        // pattern - the pattern for naming the output file
        // limit - the maximum number of bytes to write to any one file
        // count - the number of files to use
        // append - specifies append mode
        FileHandler fileHandler = new FileHandler(MobydroidStatic.LOG_PATH, LOG_LIMIT, LOG_COUNT, LOG_APPEND);
        // create a custom Formatter
        fileHandler.setFormatter(new Formatter() {
            @Override
            public String format(LogRecord record) {
                StringBuilder builder = new StringBuilder();
                builder.append((new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")).format(new Date(record.getMillis()))).append(" - ");
                builder.append("[").append(record.getLevel()).append("] - ");
                builder.append(formatMessage(record));
                builder.append("\n");
                return builder.toString();
            }
        });
        LOGGER.addHandler(fileHandler);
        // enable logging
        logEnabled = true;
        // first test ;)
        Log.log(Level.INFO, "Logger", "initialized");
    } catch (SecurityException | IOException ex) {
        Log.log(Level.SEVERE, "Logger", ex);
    }
}
 
Example 15
Source File: BFTMapClientCloudFIT.java    From protect with MIT License 5 votes vote down vote up
private static void initLog() {
	try {
		boolean append = true;
		FileHandler fh = new FileHandler(BFTMapClientCloudFIT.class.getName() + ".log", append);
		fh.setFormatter(new SimpleFormatter());

		logger = Logger.getLogger(BFTMapClientCloudFIT.class.getName());
		logger.addHandler(fh);
	} catch (IOException e) {
		System.out.println("PROBLEMS]: " + e.getMessage());
		System.exit(-1);
	}
}
 
Example 16
Source File: ErrorLog.java    From VanetSim with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the parameters for the static class.
 *
 * @param level	the minimum level for error messages. If the severity of an error is lower than this value, nothing is logged.
 * @param dir		the directory where the error log files are located
 * @param format	the format of the log files (<code>txt</code> or <code>xml</code>)
 */
public static void setParameters(int level, String dir, String format) {
	switch (level) {
	case 2:
		logger.setLevel(Level.FINER);
		break;
	case 3:
		logger.setLevel(Level.FINE);
		break;
	case 4:
		logger.setLevel(Level.CONFIG);
		break;
	case 5:
		logger.setLevel(Level.INFO);
		break;
	case 6:
		logger.setLevel(Level.WARNING);
		break;
	case 7:
		logger.setLevel(Level.SEVERE);
		break;
	default:
		logger.setLevel(Level.FINEST);
	}
	java.util.Date dt = new java.util.Date();
	SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy_HH.mm.ss"); //$NON-NLS-1$
	try {
		FileHandler handler = new FileHandler(dir + "log_" + df.format(dt) + "." + format, true);//$NON-NLS-1$ //$NON-NLS-2$
		logger.addHandler(handler);
		logger.setUseParentHandlers(false); // don't log to console
		if (format.equals("txt")) //$NON-NLS-1$
			handler.setFormatter(new SimpleFormatter());
		else
			handler.setFormatter(new XMLFormatter());
	} catch (Exception e) {
		ErrorLog.log(Messages.getString("ErrorLog.whileSetting"), 7, ErrorLog.class.getName(), "setParameters",  e); //$NON-NLS-1$ //$NON-NLS-2$
		System.exit(1);
	}
}
 
Example 17
Source File: OLcServerShutdown.java    From Open-Lowcode with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @param port
 */
public OLcServerShutdown(int port) {
	Logger mainlogger = Logger.getLogger("");
	try {
		for (int i = 0; i < mainlogger.getHandlers().length; i++) {
			mainlogger.removeHandler(mainlogger.getHandlers()[i]);
		}
		ConsoleHandler consolehandler = new ConsoleHandler();
		consolehandler.setFormatter(new ConsoleFormatter());
		consolehandler.setLevel(Level.FINER);
		mainlogger.addHandler(consolehandler);
		File file = new File("./log/");
		System.err.println("log folder = " + file.getAbsolutePath());
		FileHandler logfilehandler = new FileHandler("./log/OpenLowcodeClient%g.log", 10000000, 1000, true);
		logfilehandler.setLevel(Level.FINEST);
		logfilehandler.setFormatter(new FileFormatter(true));
		mainlogger.addHandler(logfilehandler);
		mainlogger.setUseParentHandlers(false);
		// ------------------------------------------------------------------------------
		logger.severe("Connection to Open-Lowcode Server on localhost port " + port + " to send shutdown message");
		Socket clientsocket = new Socket("localhost", port);
		MessageSimpleReader reader = new MessageSimpleReader(
				new BufferedReader(new InputStreamReader(clientsocket.getInputStream()), 9090));
		MessageBufferedWriter writer = new MessageBufferedWriter(
				new BufferedWriter(new OutputStreamWriter(clientsocket.getOutputStream())), false);
		@SuppressWarnings("unused")
		AESCommunicator aescommunicator = AESCommunicator.performServerHandshake(reader, writer);
		writer.startNewMessage();
		writer.startStructure("SHUTDOWN");
		writer.endStructure("SHUTDOWN");
		writer.endMessage();
		writer.flushMessage();
		logger.severe("Succesfully sent shutdown message to server on port " + port);
		reader.returnNextMessageStart();
		reader.returnNextStartStructure("SHUTDOWNOK");
		reader.returnNextEndStructure("SHUTDOWNOK");
		reader.returnNextEndMessage();

		logger.severe(
				"Got last message from server before shutdown, all connections are stopped. Server will stop in less than 50ms");
		reader.close();
		writer.close();
		clientsocket.close();
	} catch (Exception e) {
		logger.severe("could not execute correctly shutdown script: " + e.getMessage());
		for (int i = 0; i < e.getStackTrace().length; i++) {
			logger.severe(e.getStackTrace()[i].toString());
		}
	}
}
 
Example 18
Source File: LoggingHelper.java    From incubator-heron with Apache License 2.0 4 votes vote down vote up
/**
 * Initialize a <tt>FileHandler</tt> to write to a set of files
 * with optional append.  When (approximately) the given limit has
 * been written to one file, another file will be opened.  The
 * output will cycle through a set of count files.
 * The pattern of file name should be: ${processId}.log.index
 * <p>
 * The <tt>FileHandler</tt> is configured based on <tt>LogManager</tt>
 * properties (or their default values) except that the given pattern
 * argument is used as the filename pattern, the file limit is
 * set to the limit argument, and the file count is set to the
 * given count argument, and the append mode is set to the given
 * <tt>append</tt> argument.
 * <p>
 * The count must be at least 1.
 *
 * @param limit the maximum number of bytes to write to any one file
 * @param count the number of files to use
 * @param append specifies append mode
 * @throws IOException if there are IO problems opening the files.
 * @throws SecurityException if a security manager exists and if
 * the caller does not have <tt>LoggingPermission("control")</tt>.
 * @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
 * @throws IllegalArgumentException if pattern is an empty string
 */
public static FileHandler getFileHandler(String processId,
                                         String loggingDir,
                                         boolean append,
                                         ByteAmount limit,
                                         int count) throws IOException, SecurityException {

  String pattern = loggingDir + "/" + processId + ".log.%g";


  FileHandler fileHandler = new FileHandler(pattern, (int) limit.asBytes(), count, append);
  fileHandler.setFormatter(new SimpleFormatter());
  fileHandler.setEncoding(StandardCharsets.UTF_8.toString());

  return fileHandler;
}
 
Example 19
Source File: UpgradeActions.java    From irontest with Apache License 2.0 4 votes vote down vote up
protected void upgrade(DefaultArtifactVersion systemDatabaseVersion, DefaultArtifactVersion jarFileVersion,
                       String ironTestHome, String fullyQualifiedSystemDBURL, String user, String password)
        throws Exception {
    Formatter logFormatter = new LogFormatter();
    ConsoleHandler consoleHandler = new ConsoleHandler();
    consoleHandler.setFormatter(logFormatter);
    LOGGER.addHandler(consoleHandler);
    LOGGER.info("Upgrading Iron Test from v" + systemDatabaseVersion + " to v" + jarFileVersion + ".");

    Path upgradeWorkspace = Files.createTempDirectory("irontest-upgrade-");
    Path logFilePath = Paths.get(upgradeWorkspace.toString(),
            "upgrade-from-v" + systemDatabaseVersion + "-to-v" + jarFileVersion + ".log");
    FileHandler logFileHandler = new FileHandler(logFilePath.toString());
    logFileHandler.setFormatter(logFormatter);
    LOGGER.addHandler(logFileHandler);
    LOGGER.info("Created temp upgrade directory " + upgradeWorkspace.toString());

    List<ResourceFile> applicableSystemDBUpgrades =
            getApplicableUpgradeResourceFiles(systemDatabaseVersion, jarFileVersion, "db", "SystemDB", "sql");
    boolean needsSystemDBUpgrade = !applicableSystemDBUpgrades.isEmpty();
    if (needsSystemDBUpgrade) {
        System.out.println("Please manually backup <IronTest_Home>/database folder to your normal maintenance backup location. Type y and then Enter to confirm backup completion.");
        Scanner scanner = new Scanner(System.in);
        String line = null;
        while (!"y".equalsIgnoreCase(line)) {
            line = scanner.nextLine().trim();
        }
        LOGGER.info("User confirmed system database backup completion.");
    }

    //  do upgrade in the 'new' folder under the temp upgrade directory
    Path oldDir;
    Path newDir = null;
    if (needsSystemDBUpgrade) {
        oldDir = Paths.get(upgradeWorkspace.toString(), "old");
        newDir = Paths.get(upgradeWorkspace.toString(), "new");
        Files.createDirectory(oldDir);
        Files.createDirectory(newDir);

        upgradeSystemDB(ironTestHome, fullyQualifiedSystemDBURL, user, password, applicableSystemDBUpgrades,
                oldDir, newDir, jarFileVersion);
    }

    copyFilesToBeUpgraded(ironTestHome, systemDatabaseVersion, jarFileVersion);

    deleteOldJarsFromIronTestHome(ironTestHome);

    copyNewJarFromDistToIronTestHome(jarFileVersion, ironTestHome);

    boolean clearBrowserCacheNeeded = clearBrowserCacheIfNeeded(systemDatabaseVersion, jarFileVersion);

    //  copy files from the 'new' folder to <IronTest_Home>
    if (needsSystemDBUpgrade) {
        String systemDBFileName = getSystemDBFileName(fullyQualifiedSystemDBURL);
        Path ironTestHomeSystemDatabaseFolder = Paths.get(ironTestHome, "database");
        Path sourceFilePath = Paths.get(newDir.toString(), "database", systemDBFileName);
        Path targetFilePath = Paths.get(ironTestHomeSystemDatabaseFolder.toString(), systemDBFileName);
        Files.copy(sourceFilePath, targetFilePath, StandardCopyOption.REPLACE_EXISTING);
        LOGGER.info("Copied " + sourceFilePath + " to " + targetFilePath + ".");
    }

    String lineDelimiter = "------------------------------------------------------------------------";
    LOGGER.info(lineDelimiter);
    LOGGER.info("UPGRADE SUCCESS");
    LOGGER.info(lineDelimiter);
    LOGGER.info("You can start Iron Test now.");
    if (clearBrowserCacheNeeded) {
        LOGGER.info("If Iron Test page is already open, refresh the page (no need to restart browser).");
    }
    LOGGER.info(lineDelimiter);
    LOGGER.info("Refer to " + logFilePath + " for upgrade logs.");
}
 
Example 20
Source File: MainActivity.java    From AndrOBD with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Set up loggers
 */
private void setupLoggers()
{
	// set file handler for log file output
	String logFileName = FileHelper.getPath(this).concat(File.separator).concat("log");
	try
	{
		// ensure log directory is available
		//noinspection ResultOfMethodCallIgnored
		new File(logFileName).mkdirs();
		// Create new log file handler (max. 250 MB, 5 files rotated, non appending)
		logFileHandler = new FileHandler( logFileName.concat("/AndrOBD.log.%g.txt"),
			250*1024*1024,
			5,
			false);
		// Set log message formatter
		logFileHandler.setFormatter(new SimpleFormatter() {
			final String format = "%1$tF\t%1$tT.%1$tL\t%4$s\t%3$s\t%5$s%n";

			@SuppressLint("DefaultLocale")
			@Override
			public synchronized String format(LogRecord lr) {
				return String.format(format,
					new Date(lr.getMillis()),
					lr.getSourceClassName(),
					lr.getLoggerName(),
					lr.getLevel().getName(),
					lr.getMessage()
				);
			}
		});
		// add file logging ...
		rootLogger.addHandler(logFileHandler);
		// set
		setLogLevels();
	}
	catch(IOException e)
	{
		// try to log error (at least with system logging)
		log.log(Level.SEVERE, logFileName, e);
	}
}