private void initLogging(int consoleLevel, int fileLevel,
			   boolean exitIfFileFails) {
    Level consoleLogLevel = LogFormatter.getLogLevel(consoleLevel);
    Level fileLogLevel = LogFormatter.getLogLevel(fileLevel);
    Level logLevel = consoleLogLevel.intValue() < fileLogLevel.intValue()
      ? consoleLogLevel : fileLogLevel;

    // Initialize the logging
    Logger root = Logger.getLogger("se");
    root.setLevel(logLevel);

    LogFormatter.setConsoleLevel(consoleLogLevel);
//     LogFormatter.setLevelForAllHandlers(logLevel);

    if (fileLevel < 6) {
      try {
	this.rootFileHandler = new FileHandler(logPrefix + "%g.log",
					       1000000, 10);
	this.rootFileHandler.setLevel(fileLogLevel);
	root.addHandler(this.rootFileHandler);
      } catch (IOException ioe) {
	log.log(Level.SEVERE, "could not log to file", ioe);
	if (exitIfFileFails) {
	  fatalError("could not log to file '" + logPrefix + "0.log'");
	}
      }
    }

    this.logFormatter = new LogFormatter();
    // Set shorter names for the log
    this.logFormatter.setAliasLevel(2);
    LogFormatter.setFormatterForAllHandlers(this.logFormatter);
  }