Locating Error Logs and Database Backups

Error Logs #

For information on Craft 4’s new logging system, refer to the documentation. The following is primarily concerned with Craft 3, and while the principles are similar, some filenames and behaviors have been updated.

Each time an exception is thrown while Craft is running, the error will be logged in storage/logs/web.log. Additionally, when the CRAFT_STREAM_LOG constant is set to true, these will be streamed to stderr.

When web.log gets too big, Craft will automatically rename it to web.log.1. If there’s already an existing web.log.1, that will be renamed to web.log.2, and so on. (Craft will keep up to 6 log files at a time, including the latest craft.log.)

If Dev Mode is enabled, there will be lots of other stuff in those logs as well. To find the actual errors, search the file for [error].

Additionally, Craft will save any fatal PHP errors to storage/logs/phperrors.log by default, or to stderr when the CRAFT_STREAM_LOG constant is set to true. The behavior can be prevented by setting the CRAFT_LOG_PHP_ERRORS constant to false.

Database Backups #

All database backups are stored in storage/backups/. Backups are created each time you update Craft; any time you request a backup from the Backup Database tool in Utilities; and when running the php craft db/backup command.

Backup filenames are a combination of your site name, a timestamp, and the Craft version number that’s currently installed. The timestamp follows the format YYYY-MM-DD-HHMMSS.

Applies to Craft CMS 3.