private void configureLogger() throws Exception {
    if ((!new File(getDirectory()).exists()) && (!new File(getDirectory()).mkdirs()))
      throw new Exception("Cann't create log-directory " + getDirectory());
    
    if ((config.getResource() != null) &&
        (!config.getResource().isEmpty()) &&
        (new File(config.getResource()).exists())) {
      if ((config.getLoggerName() == null) || (config.getLoggerName().equals("log4j"))) {
        PropertyConfigurator.configure(config.getResource());
      }
      else {
        throw new IllegalArgumentException("Logger " + config.getLoggerName() + " not suppoted.");
      }
    }
    //..clear appenders list and add appender
    doClearAppenders();
    for (int i = 0; i < config.getAppenders().length; i++) {
      doAddAppender(config.getAppenders()[i]);
    }
  }