Skip to main content

Any user requests on a website are solved by several apps. First of all, a web server communicates with the Magento PHP application. Then, Magento sends users’ queries to the database. Unfortunately, things may often go wrong during this process. In case of errors, a responsible app writes the errors and corresponds the data into a special file, called error log.

Error Log Importance

Error log is a tool that allows online merchants to do basic troubleshooting and understand the essence of issues an online store has. When you see that something is going wrong, but you have no clue what exactly is a problem, the error log will show where to find the root issue.  Monitoring these log files allows you to find and solve possible problems you may not be aware of for a long time.  

Resolving Log Errors

Depending on the type, Magento writes it’s errors in several places. It’s important to know what these locations are, so you can easily debug the errors. For example, default Magento | Adobe Commerce writes cron info to <install_directory>/var/log/cron.log and database activity logs to the var/debug/db.log file inside the Magento application directory. 

You need to focus on error type and error description. Error type indicates whether you need attention to a given error. Error description provides a short description about a particular error. Magento log system has several log levels: 

  • INFO

Your error log file contains the following format: 

[error time] main.error_type error_description

Here are some examples of the latest log errors our team were debugging after the project delivery: 

[2021-07-07 11:50:36] main.CRITICAL: TypeError: Return value of Magento\CatalogUrlRewrite\Modele\Storage\DynamicStorage::getBaseName()

[2021-07-07 05:58:12] main.CRITICAL: Unable to resolve the source file for ‘frontend/Magento/luma_new/en_US/Magento_Checkout/js/action/create-shipping-address.min.js’ [] []

When you debug issues, it’s important to follow the error time. Check the time a particular error happened and compare your logs for that particular time. Most of the errors can be debugged from your Magento log files. However, some of them require patching, so you may need the help of a savvy tech team.  

Need Help to Resolve Log Errors?

Vladimir Repalo

Vladimir Repalo

Magento Developer at Mobecls, 8+ years of experience. Feel free to ask me anything about this post in the comments below.