Website and server logs turn a vague outage into a sequence of observable events. This workflow shows how to locate the right logs, isolate 404s, 500-level failures, PHP errors, and slow requests, preserve useful evidence, and verify that a fix has actually improved reliability.
Overview
Log troubleshooting works best when you treat it as a controlled investigation rather than a search for alarming lines. Start with the user-visible symptom, define the affected time window, then correlate requests with application messages and hosting resources. The exact file names and dashboard locations vary by hosting stack, control panel, web server, runtime, and retention policy, so use the labels provided by your host instead of assuming that every installation has the same layout.
Most investigations use at least two sources:
- Access logs record requests, response status codes, paths, methods, referrers, user agents, and often response time or request identifiers.
- Error logs record web-server failures, upstream connection problems, permission issues, configuration errors, and application messages.
- Application or runtime logs capture framework exceptions, PHP warnings and fatal errors, database failures, and plugin or module messages.
- Resource and monitoring data helps connect slow requests or failures to CPU, memory, disk, database, PHP workers, or other hosting limits.
Before changing anything, record the site, environment, time zone, deployment or update that may be relevant, and the first known symptom. If the site runs on WordPress, a staging workflow can help reproduce updates safely; see the WordPress staging site workflow for a related process.
What to track
1. Locate and preserve the logs
Check the hosting dashboard, site management panel, server configuration, or provider documentation for access and error-log locations. Some platforms provide a searchable viewer; others expose downloadable files or command-line access. Confirm the retention period before beginning, because older entries may already have been rotated.
Save a read-only copy of the relevant interval when practical. Redact passwords, authorization headers, session identifiers, full query strings containing personal data, and other secrets before sharing logs. A log line can contain an IP address, email address, token, or submitted URL, so limit access to people who need it.
2. Filter by time before filtering by theory
Convert timestamps to one consistent time zone and allow for clock differences between the browser, web server, application, database, and monitoring service. Start with a narrow window around the report, then expand it if necessary. A useful incident worksheet includes:
- First observed and last observed time, including time zone
- Affected hostname, path, HTTP method, and environment
- Response status and approximate frequency
- Recent deployment, plugin, theme, configuration, DNS, or certificate change
- Relevant request ID, trace ID, IP, or user-agent value
- Suspected cause, test performed, change made, and verification result
3. Separate 404s from 500-level failures
A 404 means the requested resource was not found from the server's point of view. Review the exact path, capitalization, trailing slash, file extension, referrer, and request method. A burst of 404s may come from a deleted page, an incorrect internal link, a stale campaign URL, a bot, or a broken rewrite rule. Do not automatically treat every 404 as an outage; prioritize repeated requests for important pages and unexpected 404s after a migration.
For 500, 502, 503, and 504 responses, compare the access-log entry with the error log at the same timestamp. Look for application exceptions, upstream timeouts, refused connections, exhausted workers, permission problems, memory failures, and deployment-related configuration errors. A 502 or 504 may indicate a problem between the web server and an application process, while a 503 may reflect maintenance, capacity, or an unavailable service. The status code narrows the search, but the adjacent error message and timing provide the evidence.
4. Investigate PHP and application errors
PHP logs commonly distinguish notices, warnings, deprecated behavior, and fatal errors. Severity alone is not proof of impact: a warning may repeat without breaking a page, while a fatal error can terminate one request immediately. Group identical messages, identify the file and line number, and check whether the failing request uses a particular plugin, theme, module, route, or input.
Compare the error with the PHP version, dependency changes, memory limit, execution time, database response, and recent code deployment. Avoid enabling verbose error display on a public production site. If more detail is needed, use a controlled environment or temporary server-side logging, then remove or reduce diagnostic settings after testing. For broader WordPress hardening and recovery practices, consult the WordPress website security checklist.
5. Find slow requests
Sort or filter access logs by response time when that field is available. If it is not, compare request timestamps with application, database, and monitoring data. Track the route, method, status, response size, cache state, and frequency. A slow request that occurs once may be a normal uncached operation; the same route slowing for every visitor suggests a more persistent issue.
Correlate slow intervals with CPU, memory, disk I/O, database load, process limits, PHP workers, and bandwidth. Hosting limits can create queues that appear as application slowness, so review your plan's actual resource measurements rather than guessing. The guide to reading web hosting resource limits provides a useful checklist for that comparison.
Cadence and checkpoints
Use logs at three different cadences. During an incident, review continuously around each change and capture before-and-after evidence. After a deployment, plugin update, DNS change, or migration, check the first meaningful traffic window for new 404s, 500-level responses, PHP errors, redirects, and latency changes. For routine maintenance, review a representative sample monthly or quarterly, depending on traffic and operational risk.
A recurring review should record counts and patterns rather than isolated lines:
- Top 404 paths and whether they are legitimate, obsolete, or malicious-looking requests
- 500-level responses grouped by route, error message, and release
- Repeated PHP warnings, deprecations, and fatal errors
- Slowest routes and whether their latency is rising
- Unexpected request methods, admin paths, or authentication failures
- Log volume, retention, rotation, and available disk space
Keep a simple change log beside these observations. It makes recurring failures easier to distinguish from one-off events and helps establish whether a fix survived the next deployment.
How to interpret changes
Look for correlation, not just proximity. If 500 errors begin immediately after a code release and share the same route and exception, the release is a strong lead. If errors begin at the same time as resource saturation across multiple routes, investigate capacity or a dependency before editing application code. If only one URL returns 404 after a site move, inspect redirects and links; if many unrelated URLs do so, review rewrite rules, document roots, or deployment completeness.
A successful fix should produce measurable evidence: the failing request returns the expected status, the corresponding error message stops, response time returns to an acceptable baseline, and related routes still work. Test authenticated and unauthenticated paths where relevant, use more than one device or region when the issue may be network-specific, and monitor for recurrence after caches expire.
Do not delete logs immediately after resolving an incident. Preserve the original evidence, the diagnosis, the exact change, and the verification results. This record supports rollback decisions and prevents repeated investigation of the same failure.
When to revisit
Return to this workflow whenever users report errors, uptime monitoring detects a failure, a deployment changes behavior, or a plugin, theme, runtime, database, DNS, or hosting configuration is updated. Revisit it on a monthly or quarterly schedule to identify recurring 404s, gradually increasing latency, repeated PHP warnings, and log-retention gaps before they become visible outages.
Update your local runbook whenever the hosting panel changes its log paths, the server format changes, the runtime changes its error terminology, retention limits are revised, or your site moves between shared, managed, VPS, or cloud hosting. For migration-related checks, pair this process with the WordPress and site migration checklist.
For the next incident, begin with a timestamped worksheet, preserve the relevant logs, classify the response code, correlate the request with application and resource data, make one controlled change, and verify the result. That repeatable sequence turns website error log troubleshooting into an ongoing reliability practice rather than a last-minute search through disconnected messages.