Debugging is elimination. Make the problem happen on purpose, collect the evidence, list the possible causes, and rule them out one at a time until one is left. The evidence lives in three places: the browser console (errors in the page's code), the Network tab (every request and its status), and the server's logs (errors on the server side). Change one thing at a time, or you won't know which change fixed it.
What's the problem
Something on your site is wrong and you want to find the cause yourself, methodically, instead of guessing.
Why it happens
Most debugging goes wrong in the same ways: guessing instead of looking at evidence, changing several things at once, or fixing the symptom you see rather than the first error that caused it.
How to fix it
- Reproduce it: find the exact steps that make it happen, and whether it happens for everyone or only some people, browsers or pages.
- Open the browser's Developer Tools (F12): read the Console for errors, and the Network tab for failed requests and their status codes.
- Read the server's logs for the same moment: the web server's error log and your app's logs.
- Find the first error, not the last. Later errors are often caused by the first.
- List what could cause it, and test each one against the evidence. Rule out what doesn't fit.
- Change one thing, test, and keep or undo it.
- Confirm the fix on a case you didn't use to find it, then write down what it was.
What Preventionlabs checks
One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go; uptime checked every 5 minutes, with an email when the site goes down and when it is back; up to 50 pages from your sitemap, listing any that fail or are slow, plus broken links on them; your DNS: nameservers, addresses, DNSSEC, and records pointing at services that no longer exist; your domain's registration and expiry date. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; recent deploys and account changes, with their times.
Run your free reportYour first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.
Sources
- MDN Web Docs: JavaScript error referencereference
Errors displayed in the Web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code.
- Apache HTTP Server: Log Filesofficial docs
The server error log, whose name and location is set by the ErrorLog directive, is the most important log file.