code: public synchronized void endLog()
     {
        if (!finalized)
        {
           finishedTime = Calendar.getInstance();
           finalized = true;
           logWriter.writeEndLog();
  
           //copy backup chain log file in into Backupset files itself for portability (e.g. on another server)
           try
           {
              InputStream in = PrivilegedFileHelper.fileInputStream(log);
  
              File dest = new File(config.getBackupDir() + File.separator + log.getName());
              if (!PrivilegedFileHelper.exists(dest))
              {
                 OutputStream out = PrivilegedFileHelper.fileOutputStream(dest);
  
                 byte[] buf = new byte[(int) (PrivilegedFileHelper.length(log))];
                 in.read(buf);
  
                 String sConfig = new String(buf, Constants.DEFAULT_ENCODING);
                 sConfig = sConfig.replaceAll("<backup-dir>.+</backup-dir>", "<backup-dir>.</backup-dir>");
  
                 out.write(sConfig.getBytes(Constants.DEFAULT_ENCODING));
  
                 in.close();
                 out.close();
              }
           }
           catch (PatternSyntaxException e)
           {
              logger.error("Can't write log", e);
           }
           catch (FileNotFoundException e)
           {
              logger.error("Can't write log", e);
           }
           catch (IOException e)
           {
              logger.error("Can't write log", e);
           }
        }
     }
docs: Finalize log.