Add log to batch to be submitted to telemetry. Send batch if forceFlushSize
reached

@param log entry to add
@throws IOException if closed or uploading batch fails
187725
public void addLogToBatch(TelemetryData log) throws IOException
  {
    if (isClosed)
    {
      throw new IOException("Telemetry connector is closed");
    }
    if (!isTelemetryEnabled())
    {
      return; // if disable, do nothing
    }

    synchronized (locker)
    {
      this.logBatch.add(log);
    }

    if (this.logBatch.size() >= this.forceFlushSize)
    {
      this.sendBatch();
    }
  }
856740
public synchronized void setRequestLog(RequestLog log)
    {
        if (_requestLog!=null)
            removeComponent(_requestLog);
        _requestLog=log;
        if (_requestLog!=null)
            addComponent(_requestLog);
    }
1351766
private void buildLog() throws JSONException {
        logs = new JSONObject();
        List<String> list = Log.getReportedEntries();
        if (list != null) {
            logs.put("numberOfEntry", list.size());
            JSONArray array = new JSONArray();
            for (String s : list) {
                array.put(s);
            }
            logs.put("log", array);
        }
    }
1201528
private void addFileEntry(String entryName, InputStream inputStream) throws IOException {
		// write lazily the manifest before adding the first file
		if (manifest != null) {
			addManifestEntry();
		}

		ZipEntry entry = new ZipEntry(entryName);
		filesArchive.putNextEntry(entry);

		inputStream = new BufferedInputStream(inputStream);
		try {
			byte[] buffer = new byte[BUFFER_SIZE];
			for (;;) {
				int bytesRead = inputStream.read(buffer);
				if (bytesRead <= 0) {
					break;
				}
				write(buffer, 0, bytesRead);
			}
		} finally {
			Files.close(inputStream);
			filesArchive.closeEntry();
		}
	}
1351600
private void addManifestEntry() throws IOException {
		ZipEntry entry = new ZipEntry(JarFile.MANIFEST_NAME);
		filesArchive.putNextEntry(entry);
		try {
			manifest.write(this);
		} finally {
			filesArchive.closeEntry();
			manifest = null;
		}
	}
1104559
@Override
  public void append(Transaction txn) throws IOException {
    if (this.lastSeenZxid.compareTo(txn.getZxid()) >= 0) {
      String exStr = String.format("The zxid %s is not larger than last seen"
          + " zxid %s in the log.", txn.getZxid(), lastSeenZxid);
      throw new RuntimeException(exStr);
    }
    if (currentLog == null || currentLog.length() >= this.rollingSize) {
      Zxid zxid = txn.getZxid();
      // Close the old one if any.
      this.close();
      File logFile = new File(logDir, "transaction." + zxid.toSimpleString());
      LOG.debug("Rolling to the new log {}.", logFile.getName());
      // Adds new created log file to list.
      this.logFiles.add(logFile);
      this.currentLog = new SimpleLog(logFile);
    }
    this.lastSeenZxid = txn.getZxid();
    this.currentLog.append(txn);
  }
518420
private void addLogRecorders(Container result) {
        for (Map.Entry<String, LogRecorder> entry : logRecorders.entrySet()) {
            String name = entry.getKey();
            String entryName = "nodes/master/logs/custom/{0}.log"; // name to be filtered in the bundle
            File storedFile = new File(customLogs, name + ".log");
            if (storedFile.isFile()) {
                result.add(new FileContent(entryName, new String[]{name}, storedFile));
            } else {
                // Was not stored for some reason; fine, just load the memory buffer.
                final LogRecorder recorder = entry.getValue();
                result.add(new LogRecordContent(entryName, new String[]{name}) {
                    @Override
                    public Iterable<LogRecord> getLogRecords() {
                        return recorder.getLogRecords();
                    }
                });
            }
        }
    }
1057775
public void add(BatchEntry batchEntry) throws DatabaseEngineException {
        bufferLock.lock();
        try {
            buffer.add(batchEntry);
            batch--;
        } finally {
            bufferLock.unlock();
        }
        if (batch <= 0) {
            flush();
        }
    }
47502
public void log(Log log) {
    log.info("Counters: " + size());
    for(Group group: this) {
      log.info("  " + group.getDisplayName());
      for (Counter counter: group) {
        log.info("    " + counter.getDisplayName() + "=" + 
                 counter.getCounter());
      }   
    }
  }
858129
public void flushAllLogs(final boolean force) {
        Iterator<Log> iter = getLogIterator();
        while (iter.hasNext()) {
            Log log = iter.next();
            try {
                boolean needFlush = force;
                if (!needFlush) {
                    long timeSinceLastFlush = System.currentTimeMillis() - log.getLastFlushedTime();
                    Integer logFlushInterval = logFlushIntervalMap.get(log.getTopicName());
                    if (logFlushInterval == null) {
                        logFlushInterval = config.getDefaultFlushIntervalMs();
                    }
                    final String flushLogFormat = "[%s] flush interval %d, last flushed %d, need flush? %s";
                    needFlush = timeSinceLastFlush >= logFlushInterval.intValue();
                    logger.trace(String.format(flushLogFormat, log.getTopicName(), logFlushInterval,
                            log.getLastFlushedTime(), needFlush));
                }
                if (needFlush) {
                    log.flush();
                }
            } catch (IOException ioe) {
                logger.error("Error flushing topic " + log.getTopicName(), ioe);
                logger.error("Halting due to unrecoverable I/O error while flushing logs: " + ioe.getMessage(), ioe);
                Runtime.getRuntime().halt(1);
            } catch (Exception e) {
                logger.error("Error flushing topic " + log.getTopicName(), e);
            }
        }
    }
493912
def process_log(self, **log_item):
        
        logger.debug("Processing log item: %s", log_item)
        self.log_batch.append(log_item)
        if len(self.log_batch) >= self.log_batch_size:
            self._post_log_batch()
1082520
void put(final AbstractBatchEntry batchEntry) {
    try {
        this.queue.put(batchEntry);
    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
    if (this.queue.size() >= this.actions) {
      this.scheduler.submit(new Runnable() {
        @Override
        public void run() {
          write();
        }
      });
    }
  }
1113350
public void addChangelogFile(File changelogFile) throws IOException, ChangelogParseException {
		new ChangelogHandler(this.format.getHeader()).addChangeLog(changelogFile);
	}
278347
@Override
	public void serialize(XLog log, OutputStream out) throws IOException {
		GZIPOutputStream gzos = new GZIPOutputStream(out);
		BufferedOutputStream bos = new BufferedOutputStream(gzos);
		super.serialize(log, bos);
		bos.flush();
		gzos.flush();
		bos.close();
		gzos.close();
	}
439745
public void addFile(String zipEntry, byte[] data) throws IOException  {
		stream.putNextEntry(new ZipEntry(zipEntry));
		stream.write(data);
	}
517484
public void setLog(String log) throws ApplicationException {
	if (StringUtil.isEmpty(log, true)) return;
	this.log = log.trim();
	// throw new ApplicationException("invalid value for attribute log ["+log+"]","valid values are
	// [application, scheduler,console]");
    }
733032
@Override
    protected void publish(LogEntry entry)
    {
        Email mail = this.mapper.apply(entry);
        CompletableFuture.runAsync(() -> {
            try
            {
                mail.send();
            }
            catch (EmailException e)
            {
                throw new LogTargetException(e);
            }
        });
    }