Website error logs turn vague symptoms into evidence. This guide shows how to read logs for 404, 403, 500, timeout, SSL, DNS, and database errors; where to find them across common hosting stacks; what to record; and how to build a repeatable review routine without exposing credentials or personal data.
Overview
An error log is a time-ordered record of requests, failures, warnings, and service events. It may come from a web server such as Nginx or Apache, an application runtime such as PHP or Node.js, a database, a reverse proxy, or a cloud hosting platform. Each log answers part of the same question: what happened, when did it happen, which request or service was involved, and what failed next?
Reading logs effectively is less about memorizing every message and more about connecting evidence across layers. A browser may show a 500 response, while the web-server log only reports an upstream failure and the application log identifies a missing environment variable. Similarly, a timeout may be caused by slow database work, exhausted server resources, an overloaded application process, or a network path problem.
Start by preserving the original timestamp, hostname, request path, HTTP method, status code, response time when available, and a request or correlation ID. Then compare the event with recent deployments, DNS changes, certificate renewals, scheduled jobs, traffic changes, and infrastructure alerts. This prevents a common mistake: treating the visible browser error as the root cause.
A symptom-to-cause reference
| Symptom | What to check first | Common investigation path |
|---|---|---|
| 404 Not Found | Requested URL, routing, deployment files | Confirm the path, check rewrite rules and application routes, then compare the request with recent content or code changes. |
| 403 Forbidden | Permissions, access rules, authentication | Review file and directory permissions, web-server rules, firewall controls, and whether the request requires a valid session. |
| 500 Internal Server Error | Application and runtime logs | Find the first application exception, syntax error, failed dependency, or configuration problem recorded at the same time. |
| 502 or 504 response | Proxy-to-application connection | Check whether the upstream process is running, listening on the expected port, healthy, and completing requests within configured limits. |
| Timeout without a clear status | Response time, resource use, database activity | Look for slow queries, blocked workers, CPU or memory pressure, external API delays, and network errors. |
| SSL or certificate warning | Certificate chain, hostname, expiry, and listener | Check which certificate the affected endpoint serves and whether HTTP and HTTPS traffic reach the intended host. |
| Database connection failure | Credentials, host, port, limits, and database health | Compare the application configuration with the database endpoint and inspect connection limits, restarts, and recent changes. |
What to track
1. Request-level fields
For web-server logs, capture the timestamp with its time zone, client request path, method, status code, response size, user-agent when useful, and latency. A request ID is especially valuable because it lets you follow one request from a load balancer to the web server, application, and database. If your platform does not add one, use an application-level correlation value where practical.
Separate repeated requests from unique failures. A single crawler request for a deleted path is usually different from a sudden increase in 404 responses across important pages. Track the affected URL pattern, not only the total number of errors.
2. Application and runtime events
Application logs should record the exception type, message, component, deployment version, and request ID. A useful error entry explains what operation failed without recording passwords, session cookies, authorization headers, full payment details, or unrestricted user-submitted content.
For PHP applications, the relevant evidence may be in the PHP-FPM log or an application-specific log rather than the web-server access log. Node.js, Python, and other runtimes commonly write to standard output and standard error, which a process manager or cloud platform collects. Framework logs may also contain the stack trace and database query context needed to identify the first failure.
3. Infrastructure and dependency signals
Track CPU, memory, disk space, process restarts, worker counts, network errors, and database connection usage alongside application errors. For scheduled work, compare the log timestamp with cron or task-run history. A failed background job can create later 500 responses when the website expects a file, cache entry, or database record that was never produced. See the cloud hosting cron jobs and scheduled tasks guide for a separate review of task monitoring and recovery.
DNS and SSL failures may occur before a request reaches the application, so they often will not appear in application logs. Use DNS query results, certificate inspection, load-balancer events, and uptime checks to fill that gap. The DNS records guide and SSL troubleshooting guide provide focused checklists for those layers.
Where logs are commonly found
- Hosting control panels: Look for sections named Errors, Raw Access, Metrics, Logs, or Monitoring. Paths and retention vary by provider and plan.
- Linux web servers: Nginx and Apache commonly separate access and error logs, but the exact location depends on the distribution and virtual-host configuration.
- Containers: Inspect container standard output and error streams, orchestrator events, health checks, and ingress or proxy logs.
- Managed cloud platforms: Check the platform's application, build, deployment, request, and runtime log views. Confirm the selected service, region, and time range.
- WordPress and other CMS installations: Check the web server, PHP runtime, and CMS or plugin logs. Enable detailed debugging only for a controlled period and avoid displaying errors to public visitors.
Before troubleshooting, note the log source and time zone. A five-minute difference between a proxy and application log can make related events appear unrelated.
Cadence and checkpoints
Use a short review after every deployment, configuration change, domain or DNS update, certificate renewal, migration, and database maintenance task. Check the affected URLs, a representative authenticated path if applicable, form submissions, background jobs, and the main logs for new warnings or errors.
For routine operations, a weekly review is suitable for active development environments, while a monthly review can work for stable business websites. High-traffic or revenue-critical systems generally benefit from automated alerting rather than relying on a calendar review. The objective is not to read every line; it is to identify new patterns, repeated failures, and errors that affect important user journeys.
Keep a simple incident worksheet:
- Observed: What did the user, monitor, or support report?
- Scope: Which hostnames, paths, regions, accounts, or devices were affected?
- Time window: Record the start, end, and time zone.
- Evidence: Add sanitized log lines, request IDs, deployment versions, and related metrics.
- Change history: List deployments, DNS edits, certificate actions, dependency updates, and scheduled tasks.
- Action: Record the fix, rollback, configuration change, or escalation.
- Verification: Confirm the original failing request and nearby user journeys after the change.
Retention should match your operational needs, storage limits, privacy obligations, and any applicable internal requirements. Keep enough history to compare recurring events, but do not retain sensitive data unnecessarily. Review retention and redaction rules when changing hosting providers, logging tools, application frameworks, or runtime versions.
How to interpret changes
Read errors in context and look for the earliest meaningful failure. A later “connection refused” message may be a consequence of an application process that crashed earlier. A burst of 404s may result from one incorrect link, a changed permalink structure, a bot requesting random paths, or a deployment that omitted assets. The status code alone does not distinguish these cases.
Compare a baseline period with the incident period. Ask whether the error rate, latency, affected paths, or resource use changed at the same time. Correlation is not proof, but it helps narrow the search. If 500 responses begin immediately after a release and share a version identifier, start with that release. If timeouts occur only during a scheduled import and coincide with high database activity, inspect the job and query behavior.
Use these distinctions when narrowing the layer:
- DNS: The hostname resolves to the wrong, missing, or unexpected destination, or resolution differs between resolvers.
- SSL: The endpoint presents an unsuitable certificate, incomplete chain, wrong hostname, or incorrect listener configuration.
- Web server or proxy: The request is rejected, routed incorrectly, or cannot reach the upstream application.
- Application: The route, code, configuration, template, or dependency fails after the request is accepted.
- Database or external service: A required dependency is unavailable, slow, misconfigured, or returning an unexpected response.
- Infrastructure: Capacity, disk, process health, network connectivity, or platform events affect multiple requests or services.
When sharing evidence, redact IP addresses where they are not needed, email addresses, access tokens, cookies, authorization headers, database connection strings, and personal form data. Preserve the timestamp, error type, request ID, path pattern, and relevant version information. A sanitized excerpt is more useful than a complete log dump that creates a security risk.
When to revisit
Revisit this troubleshooting process after any recurring error, unexplained traffic spike, failed deployment, hosting migration, DNS change, SSL renewal, database change, or runtime upgrade. At minimum, review error patterns monthly or quarterly according to the website's change rate and business importance. A stable site still deserves periodic checks because dependencies, certificates, scheduled tasks, and traffic patterns can change without a code release.
Make the next review practical:
- Export or query a recent summary of 4xx and 5xx responses by path, host, and time window.
- Compare the summary with the previous review and mark new or rising patterns.
- Sample one event from each important pattern and trace its request ID across available logs.
- Check deployment, DNS, SSL, database, scheduled-task, and resource histories for matching timestamps.
- Verify fixes with the original request, an uptime check, and the user journey that matters most.
- Update the runbook with the confirmed cause, safe diagnostic commands, ownership, and rollback steps.
For broader reliability work, pair log review with website uptime monitoring. If database warnings recur, review database maintenance practices. If resource usage is consistently high, use the cloud hosting cost optimization checklist to separate inefficient workloads from a capacity problem. A repeatable log review turns isolated errors into an operational record—and gives you a better chance of correcting small failures before they become outages.