Prestashop Logs: Defining and configuring Prestashop logs

We often hear about application logs.
When there’s a problem, we look for information in the logs.
If we want to make statistics, we exploit the logs.
It would seem that these log files are very useful and can be used to do many things.
Let’s take a look at what you can find in a log file and how to configure and exploit them with Prestashop.

What is a log file?

A log file is a file in which all kinds of technical information about an application can be recorded.
Log files can be found in every application.
Every piece of software, from the operating system (Windows, iOS, Linux, Android…) to the smallest application, not forgetting servers and websites, uses a log system in one form or another.
A log file is generally a file containing information in text format.
It is used to record all kinds of information on the operation of the application.
Information can even be separated into different log files.
It is common practice, for example, to feed a log file with data concerning the various actions of users.
A common log file records errors and problems encountered by the application.
Each line stored in the file is time-stamped, so you know exactly when the action was taken or when the error occurred.
Other information is then added.
This may be a message indicating the operation performed or a description of the error, the user’s IP address, his or her identity, plus any technical information that the application’s developers or administrators deem useful.

Prestashop logs

Prestashop logs can be particularly useful.
It can happen that, following modifications to Prestashop templates, the installation of a module or updates, the site stops working.
This can be catastrophic and cause you to lose orders.
It’s a race against time to identify and correct the problem so that the Prestashop site is back online and fully operational.
It’s not always easy to gain direct access to the log files on the server hosting the Prestashop site.
You may not even have the necessary rights to access them.
Fortunately, Prestashop makes it easy to consult your logs.
You can view Prestashop logs by going to the “Advanced Settings” menu > Logs.
Easier to use than a simple text file, Prestashop’s log consultation interface allows you to view all user actions and errors that have occurred.
These can be sorted and classified according to their level of severity. Prestashop logs - prestashop log severity levels The four levels of severity listed are :

  • “For information purposes only (“notice” in English): this is all about information, not criticism.
  • “Warning”: this information, even if not critical, should attract your attention and be taken into account.
  • “Error: a problem has arisen that is more or less blocking.
    It’s important to analyze it to determine its scope and consequences.
  • “Critical errors”: these are the most serious errors, and generally cause the Prestashop site to malfunction or become totally inoperable.

By analyzing the errors reported in the Prestashop logs, it will be possible to determine the action required to address and correct the problem.

Configuring Prestashop logs

While Prestashop logs are very useful for identifying and correcting any problems your site may encounter, you probably have other things to do than constantly monitor them.
It may therefore be worth configuring Prestashop to automatically alert you by email when a certain level of error is detected.
To do this, at the bottom of the log consultation page, you’ll find an “Email alerts” option.
This allows you to specify the error level at which you would like to receive a message.
Levels range from 1 to 5, from information to critical error.
Levels 1 to 3 concern a number of messages related to Prestashop operation (of which there may be many).
Ideally, you should be notified as soon as at least a level 4 error is detected.
This way, you can ensure that your site remains operational more quickly.
On the other hand, if the Prestashop site is completely inaccessible, there’s a good chance that the logging and error monitoring system is also out of order.
In this case, it may be worth setting up an external monitoring solution that will warn you if a 500 error (internal error originating from the server) is returned by your Prestashop site.

Need help?

Need to fix an error on your Prestashop site?
Don’t hesitate to contact me now.
As a freelance Prestashop developer for over 10 years, I’ll be happy to help you with your e-commerce project.