private void configure() throws NullLocationException, FormatterInitException {
  String bufferSize=lmanager.getProperty(LogConstants.BUFFER_SIZE);
  if (bufferSize != null && bufferSize.length() > 0) {
    try {
      recCountLimit=Integer.parseInt(bufferSize);
    }
 catch (    NumberFormatException nfe) {
      Debug.warning(fileName + ":FileHandler: NumberFormatException ",nfe);
      if (Debug.messageEnabled()) {
        Debug.message(fileName + ":FileHandler: Setting buffer size to 1");
      }
      recCountLimit=1;
    }
  }
 else {
    Debug.warning(fileName + ":FileHandler: Invalid buffer size: " + bufferSize);
    if (Debug.messageEnabled()) {
      Debug.message(fileName + ":FileHandler: Setting buffer size to 1");
    }
    recCountLimit=1;
  }
  String status=lmanager.getProperty(LogConstants.TIME_BUFFERING_STATUS);
  if (status != null && status.equalsIgnoreCase("ON")) {
    timeBufferingEnabled=true;
  }
  String strCount=lmanager.getProperty(LogConstants.NUM_HISTORY_FILES);
  if ((strCount == null) || (strCount.length() == 0)) {
    count=0;
  }
 else {
    count=Integer.parseInt(strCount);
  }
  String strMaxFileSize=lmanager.getProperty(LogConstants.MAX_FILE_SIZE);
  if ((strMaxFileSize == null) || (strMaxFileSize.length() == 0)) {
    maxFileSize=0L;
  }
 else {
    maxFileSize=Long.parseLong(strMaxFileSize);
  }
  location=lmanager.getProperty(LogConstants.LOG_LOCATION);
  if ((location == null) || (location.length() == 0)) {
    throw new NullLocationException("Location Not Specified");
  }
  if (!location.endsWith(File.separator)) {
    location+=File.separator;
  }
  String strFormatter=lmanager.getProperty(LogConstants.ELF_FORMATTER);
  try {
    Class clz=Class.forName(strFormatter);
    formatter=(Formatter)clz.newInstance();
  }
 catch (  Exception e) {
    throw new FormatterInitException("Unable to initialize Formatter Class" + e);
  }
  String strRotateEnabled=lmanager.getProperty(LogConstants.ENABLE_ROTATION);
  if (strRotateEnabled != null && !strRotateEnabled.isEmpty()) {
    rotateEnabled=Boolean.parseBoolean(strRotateEnabled);
  }
  if (rotateEnabled) {
    String rotation=lmanager.getProperty(LogConstants.LOGFILE_ROTATION);
    try {
      if (rotation != null) {
        rotationInterval=Integer.parseInt(rotation);
      }
    }
 catch (    NumberFormatException nfe) {
      rotationInterval=-1;
    }
    if (rotationInterval > 0) {
      lastRotation=currentTimeMillis();
      rotatingBySize=false;
    }
  }
}

private void configure ( ) throws NullLocationException , FormatterInitException { String bufferSize = lmanager . getProperty ( LogConstants . BUFFER_SIZE ) ; if ( bufferSize != null && bufferSize . length ( ) > 0 ) { try { recCountLimit = Integer . parseInt ( bufferSize ) ; } catch ( NumberFormatException nfe ) { Debug . warning ( fileName + ":FileHandler: NumberFormatException " , nfe ) ; if ( Debug . messageEnabled ( ) ) { Debug . message ( fileName + ":FileHandler: Setting buffer size to 1" ) ; } recCountLimit = 1 ; } } else { Debug . warning ( fileName + ":FileHandler: Invalid buffer size: " + bufferSize ) ; if ( Debug . messageEnabled ( ) ) { Debug . message ( fileName + ":FileHandler: Setting buffer size to 1" ) ; } recCountLimit = 1 ; } String status = lmanager . getProperty ( LogConstants . TIME_BUFFERING_STATUS ) ; if ( status != null && status . equalsIgnoreCase ( "ON" ) ) { timeBufferingEnabled = true ; } String strCount = lmanager . getProperty ( LogConstants . NUM_HISTORY_FILES ) ; if ( ( strCount == null ) || ( strCount . length ( ) == 0 ) ) { count = 0 ; } else { count = Integer . parseInt ( strCount ) ; } String strMaxFileSize = lmanager . getProperty ( LogConstants . MAX_FILE_SIZE ) ; if ( ( strMaxFileSize == null ) || ( strMaxFileSize . length ( ) == 0 ) ) { maxFileSize = 0L ; } else { maxFileSize = Long . parseLong ( strMaxFileSize ) ; } location = lmanager . getProperty ( LogConstants . LOG_LOCATION ) ; if ( ( location == null ) || ( location . length ( ) == 0 ) ) { throw new NullLocationException ( "Location Not Specified" ) ; } if ( ! location . endsWith ( File . separator ) ) { location += File . separator ; } String strFormatter = lmanager . getProperty ( LogConstants . ELF_FORMATTER ) ; try { Class clz = Class . forName ( strFormatter ) ; formatter = ( Formatter ) clz . newInstance ( ) ; } catch ( Exception e ) { throw new FormatterInitException ( "Unable to initialize Formatter Class" + e ) ; } String strRotateEnabled = lmanager . getProperty ( LogConstants . ENABLE_ROTATION ) ; if ( strRotateEnabled != null && ! strRotateEnabled . isEmpty ( ) ) { rotateEnabled = Boolean . parseBoolean ( strRotateEnabled ) ; } if ( rotateEnabled ) { String rotation = lmanager . getProperty ( LogConstants . LOGFILE_ROTATION ) ; try { if ( rotation != null ) { rotationInterval = Integer . parseInt ( rotation ) ; } } catch ( NumberFormatException nfe ) { rotationInterval = - 1 ; } if ( rotationInterval > 0 ) { lastRotation = currentTimeMillis ( ) ; rotatingBySize = false ; } } }
this method is used for getting the properties from logmanager and setting the private variables count , maxfilesize etc .
