public static void main(String[] args) {
    int port = Integer.parseInt(properties.getProperty("port0"));
    String ip = properties.getProperty("serverIp");
    String logFile = properties.getProperty("logFile");
    Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, "Sever started");
    try {
      Utils.setLogFile(logFile, ChatServer.class.getName());
      serverSocket = new ServerSocket();
      serverSocket.bind(new InetSocketAddress(ip, port));
      do {
        Socket socket = serverSocket.accept(); //Important Blocking call
        Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, "Connected to a client");        
        ClientHandler clientHandler = new ClientHandler(socket);
        clients.add(clientHandler);
        new Thread(clientHandler).start();
      } while (keepRunning);
    } catch (IOException ex) {
      Logger.getLogger(ChatServer.class.getName()).log(Level.SEVERE, null, ex);
    }
    finally {
        Utils.closeLogger(ChatServer.class.getName());
    }
  }