Log File Analysis for SEO: What Your Server Logs Tell You

Every time anything requests a page from your site, your server writes a line in a log file. Users, crawlers, scrapers, monitoring tools, all of them. That log is the only place you can see exactly what Googlebot did on your site, rather than what a crawl tool or Search Console reports.
Analytics platforms tell you about people. Log files tell you about bots, and bots are the part of your traffic that decides whether your pages get indexed.
What a log line gives you
A typical entry records the timestamp, the IP address, the requested URL, the status code returned, the user agent and a few other details. From that alone you can answer questions that are impossible to answer any other way. How often does Googlebot visit a given section? Which URLs get crawled daily and which have not been touched in months? What status codes are bots actually receiving?
Search Console gives you aggregates and a crawl stats report. Logs give you every single request, which is where the interesting problems hide.

Where Googlebot is wasting its time
The first thing I look for is where crawl activity is concentrated. On large sites it is rarely the pages you would want. Common findings include parameterised URLs from faceted navigation crawled thousands of times a day, redirect chains followed repeatedly, expired URLs from an old site structure still being fetched years later, and endless combinations of calendar or filter pages that should never have been crawlable.
If Googlebot is spending most of its requests on URLs that can never rank, your important pages are competing for attention against your own mess. Logs make that visible in an hour.
Finding the pages nobody crawls
The reverse is just as useful. Take your sitemap or a list of pages you care about, and look for the ones that do not appear in the logs at all. If Googlebot never requests a page, it is either undiscovered or considered worthless. Either way it will not rank.
This is also how you spot orphan pages. If a URL appears in the logs but has no internal links, Google is finding it somewhere else, probably an old sitemap or an external link you forgot about.
Checking it really is Googlebot
Anyone can set their user agent to Googlebot, and a lot of scrapers do. If you are going to make decisions based on bot behaviour, verify the traffic. Google publishes its IP ranges and supports a reverse DNS check: look up the IP, confirm it resolves to a googlebot.com or google.com host, then forward-resolve that hostname back to the same IP.
In practice I filter the logs to verified Googlebot requests and treat everything else claiming the name as noise, or as a security question rather than an SEO one.

Getting hold of the logs
This is usually the hard part. Ask your host or your developers for access, and ask early, because many hosts only keep a few days of history. If the site sits behind a CDN like Cloudflare there may be separate options for logging there.
For tooling, grep and awk will take you surprisingly far on a modest site. Screaming Frog's Log File Analyser is the easy route for a readable breakdown. On genuinely large sites the logs get pushed into something like BigQuery and queried properly.
Worth the effort
Most SEO problems are inferred. Crawl tools guess at what Google might do, and Search Console shows you summaries. Logs are the one source that shows what actually happened, request by request. If a site has a crawl or indexation problem you cannot explain any other way, the answer is usually sitting in a file that has been there all along.