Analyze the logs

Server Logs Error

In the error log, the web server records errors it encounters while processing HTTP requests it receives when visitors browse or attack your WordPress site. Thus, you can find information such as:

  • Date and time the problem occurred,
  • Level of severity of the error,
  • The IP address of the client that generated the error,
  • The error itself.

The web server error log is the most important log file. You will look at it first if you encounter problems starting a service or running an operation. It contains vital information when, for example, you are troubleshooting an HTTP 500 error, a file authorization problem, or a problem with a plugin that interacts directly with the web server.

Display error logs

Go to your console and click on the button Manage to go to the management interface of your WordPress.

At the bottom you will see the section Server Logs Error.

Click on the button See the last 50 lines.

Please note that this button is only displayed if you have errors logged for your site. Otherwise, you will get the following display when there are no error logs.

The interface will show you the list of errors directly in your browser.

Download error logs

Click on the button Download error logs.

Now that you have this file on your computer, open it with your favorite text editor (Notepad, Notepadd++, Sublime Text, Visual Code, Bracket or other) to view the lines of code.

These are actually error lines or warnings recorded on your site. In general, you should watch out for the last lines with the mention Fatal Error as follows:

[05-Nov-2020 07:05:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/clients/prod/monsitewordpress/wp-content/plugins/wp-links-page-pro-developer/includes/csv-export.php:16 Stack trace: #0 {main} thrown in /home/clients/client/prod/wp/wp-content/plugins/wp-links-page-pro-developer/includes/csv-export.php on line 16

On this error line, you see that a plugin name is quoted: WP Links Page Pro Developer.

In our case, the error Call to undefined function mysql_connect() indicates that the plugin calls a function mysql_connect() which has not been defined. But the most important thing is to know which plugin is involved.

You need to access your WordPress via FTP in order to deactivate this plugin that blocks the display of your site.

Once connected in FTP, you just have to go in the plugin folder (/wp-content/plugins/), and delete or rename the plugin folder, adding for example .disabled at the end of the name.

Now reload your page. You should see your site appear again.

Empty error logs

You can empty the error logs of your WordPress site at any time. Be careful though, you should not apply this dump without having downloaded the logs first. The deletion is indeed irreversible.

Click on the button Empty the log file.

Access Logs Server

The access log is where the web server keeps a history of all processed HTTP requests. Therefore, you will find information about:

  • IP address of the device from which the HTTP request originated,
  • User ID in case the user is authenticated via HTTP,
  • Date and time when the web server finished processing the request,
  • Request line including the HTTP method, the requested object, and the protocol,
  • HTTP response code to this request,
  • Size in bytes of the object sent in response,
  • Other generic information such as the user-agent string of the applicant.

Generally, this information is useful if you are solving a particular user problem.

Nowadays, access log files are mainly used to solve connectivity and access problems.

View server logs

Go to your console and click on the button Manage to go to the management interface of your WordPress. You will see at the bottom the section Server Logs Error.

Click on the button See the last 50 lines.

The interface will show you the list of errors directly in your browser.

Download server logs

Click on the button Download access logs.

Now that you have this file on your computer, open it with your favorite text editor (Notepad, Notepadd++, Sublime Text, Visual Code, Bracket or other) to view the lines of code.

It is not possible to empty the access log file following the obligation imposed by Article 6 II, decreed on March 24, 2006 for ISPs.

The obligation to preserve data is valid for an optimal period of one year. After this period, the data can be anonymized.

Updated on 11 February 2021

Related Articles