It doesn't work if the website is hosted on GitHub Pages or Netlify. Having a CDN such as CloudFlare will make log files on your server useless too.
It's not a perfect comparison but I am still on the lookout for the cheapest way to host a static site while retaining access to access logs.
As for CloudFlare, all the requests will go through CloudFlare's server for caching, so some request won't reach your server.
Only for static files, they don't cache HTML and dynamic contents. So you can still make sense of unique visitors to your site.