I know most, if not all, ISPs log the IPs you had tied to your network, but do ISPs keep logs of the IPs you have tried to connect to? For example, let's say I went to google.com, would the ISP be able to go through their logs and find whether I have ever connected to that site?
I cannot give a source nor which ISP this concerns since someone accidentally crossed their NDA by telling me this, but I think it should be known that there are ISPs that, at least in the Netherlands, log all DNS requests. This would mean that any hostname you ever looked up will be logged, including google.com, regardless of whether you really connected to the associated IP addresses. It is very reasonable to assume that a judge might find it convincing evidence that you really did visit the website. (Sidenote: DNS traffic that was merely passing through, not actually directed at the ISP's own DNS servers, was probably not logged, though this is not certain.)
The ISP in question tried to log as little as possible simply because it costs them money, but they are required to do this in order to comply with the law in the Netherlands. They (nor any other ISP) don't mention anything at all about what kind of data they log, they merely tell you in the terms of service that they log "as much as required by law".
I never thought they would log each and every DNS request, and I'm fairly sure that people here also wouldn't like it if they knew that they are indiscriminately being tapped 24/7. On Google I can't find any mention of that ISP doing that, nor any other Dutch ISP, so I'm not sure this information is public. I myself knew such information had to be logged about phones, the law is very clear in that sense (it mentions exactly which data needs to be logged), but logging DNS goes further in my opinion. Anyhow, this discussion gets political very fast.
More to the point, yes your ISP can do this and might even be required to do this by law, regardless of whether the police (or intelligence agency) placed a tap on your connection. In the Netherlands ISPs are required to store the logs for 6 months, but this may vary per country.
They can also, though probably not legally or without telling you, tap your connection's contents. This means not only which domains you looked up or which IPs you connected to, but also the data that was sent to them. This usually only happens in the event of a tap, or possibly when they themselves detect some sort of abuse. It might also be that they automatically process all data in search for keywords or certain protocols, such as bittorrent handshakes or Tor traffic. However legal or not, they have the technical capability to do this without anyone knowing.
OfCourse, that's almost their purpose... your connection before reaching google.com passes through their servers... that's why you need an ISP, therefore they're able to see everything that you do online, unless you use a VPN or somekind of proxy, the ISP could still see the proxy/VPN but your ISP won't know what you did while using the proxy/VPN, in that case only the proxy/VPN would know.
A lot of ISP's use tools like Netflow for generating statistics of traffic on their network. This statistics can be used for route optimization and DDoS mitigation for example. Often sampling is used, so data of one in every few hundred packets is inspected, but it is possible to do 1:1 sampling on some equipment.
Netflow data can contain source and destination IP addresses and TCP/UDP port numbers, so it could be used by an ISP which deploys netflow to analyse your browsing behaviour.
Yes, they can and often do log such things. This has been a big deal among the community of people who use VPNs to attempt to be anonymous. Many VPN providers claim they don't log your activity so the activity cannot be obtained by law enforcement. Whether the VPN provider keeps logs may not be true but you don't only have to worry about your VPN provider logging your activity but their upstream provider as well. This guy got arrested over this very issue:
At my company we keep DNS logs, sflow logs, web proxy logs, as much data as possible. Logstash and Hadoop make it easy to keep terabytes of logs for years. But our users don't want to be anonymous and don't want to interact with anyone anonymously.