Laravel writes almost every error, warning and failed job to one file: storage/logs/laravel.log. Reading that file well — finding the newest entry, reading the message before the stack trace, and matching it to a fix — turns a blank 500 page into a named problem you can solve in minutes. The log already contains the answer.

We read logs every day when helping buyers install scripts. The browser shows nothing useful; the log shows everything. Learn to read it and you stop guessing.

Where are Laravel logs, and which file matters?

By default, Laravel writes to storage/logs/laravel.log inside your project folder. That is the file you want in almost every case. Laravel can also split logs by day, in which case you will see files like laravel-2026-11-30.log instead of a single file — same content, just one file per day. The setting that controls this lives in your .env file as LOG_CHANNEL: stack writes to the single file, daily writes one file per day.

Two things to check first. The storage folder must be writable by the web server, or Laravel cannot write the log at all. Our guide to fixing permission errors on storage and cache folders covers this. And make sure you are reading the log on the live server, not an old copy on your own computer.

How do you open the log on shared hosting?

SSH is the better option when it is available. Log in through cPanel's Terminal or SSH, go to your project folder, and run tail -n 200 storage/logs/laravel.log to see the last 200 lines. Add -f to watch live while you reload the page: trigger the error in your browser and the new entry appears within a second.

Without SSH, use cPanel's File Manager. Open storage/logs, open laravel.log, and scroll to the bottom — entries are written newest-last, so the fresh error is at the end. Downloading the file and searching it on your own computer is easier when the log is large.

Whichever way you open it, always start from the bottom. The top of the file may hold errors from months ago that have nothing to do with today's problem.

How do you read a log entry?

A typical entry starts with a timestamp, the environment and the log level, then the message, then a long stack trace. Read it in that order and stop early — the first two or three lines usually name the problem.

Here is a real example, shortened:

[2026-11-30 10:15:22] production.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'myuser'@'localhost' (using password: YES)

That one line tells you the date and time, that the site runs in production mode, that this is an error, and that the database rejected the login. The stack trace below it lists the files Laravel passed through before failing — useful for developers, but you do not need it to fix a wrong database password. The rule we use: read the message line first, fix what it says, and only dig into the stack trace if the message is vague.

The log level matters too. ERROR means something failed; WARNING means something odd happened but the request continued. When debugging a broken page, ignore everything except ERROR entries from around the time it failed.

What do the most common log messages actually mean?

Message you will seeWhat it meansFix
Access denied for user (SQLSTATE 1045)Wrong database username or password in .envCorrect DB_USERNAME and DB_PASSWORD, then run php artisan config:clear
Unknown database (SQLSTATE 1049)The database name in .env does not existCreate the database in cPanel, or fix DB_DATABASE
Connection refused (SQLSTATE 2002)Laravel cannot reach the database serverCheck DB_HOST, usually localhost on shared hosting
Permission denied in storage/logs or storage/frameworkThe web server cannot write to the storage folderSet storage and bootstrap/cache to 775, and check folder ownership
Class not foundA package is missing or the autoloader is staleRun composer dump-autoload, or reinstall vendor if it was never uploaded
View not foundA Blade template file is missing or misnamedCheck the view file exists with the exact name and path
The stream or file could not be openedLaravel cannot write a log or cache fileFix storage permissions, then check disk space on the account

When a message is not in this table, copy the first line — not the whole stack trace — into a search engine. Someone has almost always hit the same error. Our guide to 9 common errors after installing a Laravel script covers the same ground from the install side.

How do you clear and rotate logs safely?

Log files grow forever by default, and a neglected laravel.log can eat a surprising amount of disk on a small hosting account. The cleanest fix is to switch to daily logs by setting LOG_CHANNEL=daily in .env, then running php artisan config:clear. Laravel will then write one file per day and delete files older than 14 days on its own.

To clear the current log by hand, delete the file or empty it — Laravel recreates it on the next error. Never delete the storage/logs folder itself. And do not clear the log before you have read it: the entry you needed may have been the only copy of the error.

A short routine that keeps logs useful:

  • Reproduce the error, then read the newest entry at the bottom of the log.
  • Note the timestamp and match it to the moment the page failed.
  • Fix the cause, clear the config cache, and reload the page.
  • Check the log again — a new entry with the same time means the fix did not work.
  • Set LOG_CHANNEL=daily so old logs clean themselves up.

What if the log is empty or missing?

An empty log when the site is clearly broken usually means Laravel cannot write to storage at all. Check the folder permissions first: storage and everything inside it should be writable by the web server user. If the permissions look right, check disk space — a full hosting account cannot write logs either.

Another possibility is that logging is pointed somewhere else. Check LOG_CHANNEL in .env: syslog or errorlog sends entries to the server log instead of the file, and null turns logging off entirely. Set it to stack or daily and clear the config cache.

If the log exists but your error is not in it, the failure may be happening before Laravel boots — a wrong PHP version, a broken .htaccess, or a missing vendor folder. Then the server error log in cPanel is the file to check. The cPanel installation guide covers the boot-level checks, and the FAQs answer the setup questions we hear most. Still stuck? Our support is a real human on WhatsApp at +92 333 4916432, or by email at contact@zqdevelopers.com.