private Agent createAgent(final Properties props) throws IOException, AdminException {
    DistributionManager.isDedicatedAdminVM = true;
    SystemFailure.setExitOK(true);

    final AgentConfigImpl config = createAgentConfig(props);

    // see bug 43760
    if (config.getLogFile() == null || "".equals(config.getLogFile().trim())) {
      config.setLogFile(AgentConfigImpl.DEFAULT_LOG_FILE);
    }

    logger = config.getLogWriter();
    OSProcess.redirectOutput(
        new File(config.getLogFile())); // redirect output to the configured log file

    return AgentFactory.getAgent(config);
  }