code: public void setBufferSize(final int size) {
      //
      //   log4j 1.2 would throw exception if size was negative
      //      and deadlock if size was zero.
      //
      if (size < 0) {
        throw new java.lang.NegativeArraySizeException("size");
      }
  
      synchronized (buffer) {
        //
        //   don't let size be zero.
        //
        bufferSize = (size < 1) ? 1 : size;
        buffer.notifyAll();
      }
    }
docs: Sets the number of messages allowed in the event buffer
  before the calling thread is blocked (if blocking is true)
  or until messages are summarized and discarded.  Changing
  the size will not affect messages already in the buffer.
  
  @param size buffer size, must be positive.