public void publish(LogRecord lrecord){
  if (MonitoringUtil.isRunning() && fileLogHandlerForMonitoring != null) {
    fileLogHandlerForMonitoring.incHandlerRequestCount(1);
  }
  if (maxFileSize <= 0) {
    return;
  }
  if (!isLoggable(lrecord)) {
    return;
  }
  Formatter formatter=getFormatter();
  String message=formatter.format(lrecord);
synchronized (this) {
    recordBuffer.add(message);
    if (recordBuffer.size() >= recCountLimit) {
      if (Debug.messageEnabled()) {
        Debug.message(fileName + ":FileHandler.publish(): got " + recordBuffer.size()+ " records, writing all");
      }
      nonBlockingFlush();
    }
  }
}

public void publish ( LogRecord lrecord ) { if ( MonitoringUtil . isRunning ( ) && fileLogHandlerForMonitoring != null ) { fileLogHandlerForMonitoring . incHandlerRequestCount ( 1 ) ; } if ( maxFileSize <= 0 ) { return ; } if ( ! isLoggable ( lrecord ) ) { return ; } Formatter formatter = getFormatter ( ) ; String message = formatter . format ( lrecord ) ; synchronized ( this ) { recordBuffer . add ( message ) ; if ( recordBuffer . size ( ) >= recCountLimit ) { if ( Debug . messageEnabled ( ) ) { Debug . message ( fileName + ":FileHandler.publish(): got " + recordBuffer . size ( ) + " records, writing all" ) ; } nonBlockingFlush ( ) ; } } }
format and publish a logrecord . < p > this filehandler is associated with a formatter , which has to format the logrecord according to elf and return back the string formatted as per elf . this method first checks if the header is already written to the file , if not , gets the header from the formatter and writes it at the beginning of the file .
