public synchronized void log (String message, Object...args)
    {
        // construct the message
        message = Logger.format(message, args);
        StringBuffer buf = new StringBuffer(message.length() + TIMESTAMP_LENGTH);
        _format.format(new Date(), buf, _fpos);
        buf.append(message);

        // and write it to the log
        boolean wrote = false;
        if (_logWriter != null) {
            _logWriter.println(buf.toString());
            wrote = !_logWriter.checkError();
        }

        // log an error if we failed to write the log message
        if (!wrote) {
            // be careful about logging zillions of errors if something bad happens to our log file
            if (_throttle.throttleOp()) {
                _throttled++;
            } else {
                if (_throttled > 0) {
                    log.warning("Suppressed " + _throttled + " intervening error messages.");
                    _throttled = 0;
                }
                log.warning("Failed to write audit log message", "file", _logPath, "msg", message);
            }
        }
    }
public synchronized void log ( String message , Object ... args ) { message = Logger . format ( message , args ) ; StringBuffer buf = new StringBuffer ( message . length ( ) + TIMESTAMP_LENGTH ) ; _format . format ( new Date ( ) , buf , _fpos ) ; buf . append ( message ) ; boolean wrote = false ; if ( _logWriter != null ) { _logWriter . println ( buf . toString ( ) ) ; wrote = ! _logWriter . checkError ( ) ; } if ( ! wrote ) { if ( _throttle . throttleOp ( ) ) { _throttled ++ ; } else { if ( _throttled > 0 ) { log . warning ( "Suppressed " + _throttled + " intervening error messages." ) ; _throttled = 0 ; } log . warning ( "Failed to write audit log message" , "file" , _logPath , "msg" , message ) ; } } }
Builds a log entry out of the given message and args using
{@link Logger#format(Object, Object...)}, prefixes it with the current date and time,
appends a newline to it and writes it to the log.