Are you experiencing unknown errors or bugs with your WordPress site? If the answer is yes then now may be the time to set up WordPress error logs in the wp-config file. The wp-config file controls not only your settings but is also a powerful debugging tool. This tool can help you find any errors plaguing your site by identifying the offending script or plugin that might be causing the issue and is invaluable useful to any WordPress developer as a result. In this article, we will explore how to create an error log and then how to review it afterwards.
First of all, you will need to edit your wp-config.php file by accessing the File Manager in your cPanel dashboard. The wp-config.php file can be found in the root directory of your website. Once located, open the file in any text editor. Find the line that reads "That’s all, stop editing! Happy blogging".
It is just before this line that you will need to add the following code:
, true );
By adding this code, you are turning on the WordPress debug mode. In this mode, you will be presented with errors and bugs within your WordPress admin area. If you would like your errors to be logged then you will need to add the following line of code just below the line you have added:
, true );
Once you have added your code, save your changes and upload the text back into your wp-config.php file and back to your website.
Reviewing your error logs once they have been created is really simple. All you need to do is access the file manager in cPanel once again and head to the /wp-content/ folder. Once inside you will find a file called debug.log.
This file contains all WordPress errors, bugs, warnings and notices that have occurred on your site and can be viewed or downloaded.