Program: 67676
Project: 67676
Buggy source:
/** 
 * This function should only called by the main application that starts BIRT. It will add a new log handler to the global BIRT logger.
 * @param directoryName -the directory name of the log file (e.g. C:\Log). The final file name will be the directory name plus an unique file name. For example, if the directory name is C:\Log, the log file name will be something like C:\Log\ReportEngine_2005_02_26_11_26_56.log
 * @param logLevel -the log level to be set. If logLevel is null, it will be ignored.
 */
public static void startEngineLogging(Logger logger,String directoryName,String file,Level logLevel){
  Logger rootLogger=Logger.getLogger(BIRT_NAME_SPACE);
  if (sharedHandler == null) {
    sharedHandler=new EngineLoggerHandler(rootLogger);
    sharedHandler.setLevel(Level.ALL);
    rootLogger.addHandler(sharedHandler);
  }
  if (fileLogger != null) {
    closeFileLogger(fileLogger);
    fileLogger=null;
  }
  if (logger != null && isValidLogger(logger)) {
    userLogger=logger;
    sharedHandler.setSharedLogger(userLogger);
  }
 else {
    if (directoryName != null) {
      dirName=directoryName;
    }
    if (file != null) {
      fileName=file;
    }
    if (logLevel == null) {
      logLevel=rootLogger.getLevel();
    }
    if (logLevel != Level.OFF && (dirName != null || fileName != null)) {
      fileLogger=createFileLogger(dirName,fileName);
      sharedHandler.setSharedLogger(fileLogger);
    }
    rootLogger.setLevel(logLevel);
  }
  rootLogger.setUseParentHandlers(false);
}

Fixed version (ground truth):
/** 
 * This function should only called by the main application that starts BIRT. It will add a new log handler to the global BIRT logger.
 * @param directoryName - the directory name of the log file (e.g. C:\Log). The final file name will be the directory name plus an unique file name. For example, if the directory name is C:\Log, the log file name will be something like C:\Log\ReportEngine_2005_02_26_11_26_56.log
 * @param logLevel - the log level to be set. If logLevel is null, it will be ignored.
 * @param rollingSize
 * @param maxBackupIndex
 */
public static void startEngineLogging(Logger logger,String directoryName,String file,Level logLevel,int rollingSize,int maxBackupIndex){
  Logger rootLogger=Logger.getLogger(BIRT_NAME_SPACE);
  if (sharedHandler == null) {
    sharedHandler=new EngineLoggerHandler(rootLogger);
    sharedHandler.setLevel(Level.ALL);
    rootLogger.addHandler(sharedHandler);
  }
  if (fileLogger != null) {
    closeFileLogger(fileLogger);
    fileLogger=null;
  }
  if (logger != null && isValidLogger(logger)) {
    userLogger=logger;
    sharedHandler.setSharedLogger(userLogger);
  }
 else {
    if (directoryName != null) {
      dirName=directoryName;
    }
    if (file != null) {
      fileName=file;
    }
    if (logLevel == null) {
      logLevel=rootLogger.getLevel();
    }
    logRollingSize=rollingSize;
    logMaxBackupIndex=maxBackupIndex;
    if (logLevel != Level.OFF && (dirName != null || fileName != null)) {
      fileLogger=createFileLogger(dirName,fileName,logRollingSize,logMaxBackupIndex);
      sharedHandler.setSharedLogger(fileLogger);
    }
    rootLogger.setLevel(logLevel);
  }
  rootLogger.setUseParentHandlers(false);
}