Your shopping cart is empty!
Error logs can be very useful for solving and debugging the problems of an OpenCart-based site. Reading them allows us to know quickly, what is the state of health of an application based on OpenCart.
In this article, we explain what is an error log, what are the types of error logs that we can find in OpenCart, how to configure them and why you should know and review these logs periodically.
An error log is a document where all errors that occur in a web application are stored. Usually each record indicates the precise date and time the error occurred, a more or less technical indication or description of why an error occurred, and the specific location of the file where it occurred.
In the case of OpenCart, there are three types of error logs that we recommend to consult periodically, and that not only provides us with information about the health status of the application, but also allows us to know if there has been a periodic or specific incident after any intervention, how to install an extension or after receiving an order from a customer.
If a user experiences an error in the store, an error caused by PHP processing, the error will be displayed in a log that you can find in the administrator following the following the path: System > Maintenance > Error logs. In case it is not accessible by this route (because the weight of the file exceeds the memory capacity that the server can have for reading), you can consult the error log by accessing the server and consulting the files that are defined in the path which you will find in the configuration variable "DIR_LOGS". The “DIR_LOGS” variable can be consulted by accessing the config.php file that is located at the root of the OpenCart site.
In order for the errors produced in the store to be correctly registered, the administrator must have his registration enabled in OpenCart in System > Store > Server tab > Logs section, where the field “Log errors” must be enabled.
Many extensions in OpenCart contain OCMOD modules that allow modifications to the OpenCart core, without having to overwrite the original files. However, it is always possible that these modules present errors, and when it is the case that the modifications introduced by this type of module do not get to be executed (an issue that can happen because the file to be modified has not been found, or the line of code not been found), errors will not be recorded in the PHP error log.
It is convenient to check what modifications have been register, but are not being executed correctly, and this can be done by consulting in the store catalog, in the config.php file the location of the error logs defined in the variable “DIR_LOGS” ; and within this folder you will find a file called ocmod.log that reflects all the errors that occur in this system.
There are stores that use outdated extensions, or whose developers have not wanted to update their modifications to the OCMOD module, and instead use an outdated version called vQmod, whose operation is very similar to OCMOD modules, with the difference that the vQmod system is not integrated into the OpenCart core.
The vQmod modules allow modifications to the OpenCart core, without having to overwrite the original files. However, it is always possible that these modules present errors, and when it is the case that the modifications introduced by this type of module do not get to be executed (an issue that can happen because the file to be modified has not been found, or the line of code to be modified), errors will not be recorded in the PHP error log.
If the store is using vQmod modules, it is convenient to periodically review what modifications have been made, but they are not being executed correctly, and this can be done by consulting the root of the website on the server in the / vqmod / logs / directory; where it will be possible to consult all the errors that occur in this system.
If the store presents a large number of errors, the registration may not be accessible from the administration. Then you must download the file from the server to analyze the records it contains.
It is worth commenting that if this is your case, you should know that your application may have a compromised state of health. In this state, the records, integrity of the information in your database of products, customers, transactions and everything that happens and has happened on your OpenCart site may be violated. If you do not know how to proceed and the implications that these errors have for your store, you can contact us to receive a commercial proposal and we will solve them.