InfoPhilicHow toHow to Set Up WordPress Error Logs using WP-Config

How to Set Up WordPress Error Logs using WP-Config

Diagnosing WordPress issues can be daunting. Similarly, monitoring of your site’s PHP errors is crucial. At the point when left undetected, PHP errors can lessen execution, squander data transfer capacity, and leave your site defenseless against vindictive assault.

PHP errors usually occur unpredictably and spontaneously and may be triggered by even the slightest changes to your server configuration, database setup, or WordPress files. Monitoring them is something that all responsible WordPress administrators should be doing.

In this article, I will show you how to set up WordPress error logs in the wp-config file.

What is a wp-config file?

The wp-config.php file is a WordPress configuration file that contains imperative WordPress settings. These settings advise your site how to associate with your WordPress database, which database table prefix to utilize, and produces confirmation keys to make your WordPress site more secure.

Aside from default WordPress settings, the wp-config file can likewise be utilized to characterize a few different parameters. It can likewise empower WordPress investigating mode and spare WordPress mistake logs.

This encourages you to discover WordPress errors by distinguishing the modules or contents that are causing them. You would then be able to simply ahead and discover a fix for those WordPress blunders.

How to Set up WordPress Error Logs in WP-Config File?

For this, you need to edit your wp-config.php file, which locates in the root directory of your website.

Before the line that denotes, ‘That’s all, stop editing! Happy blogging’, Paste the following code:

define( 'WP_DEBUG', true );

NOTE: Sometimes, the code is already present in your file but is set to false. In this case, you have to change it with true.

  • The code will enable debug mode in WordPress.
  • To keep the error to be logged, you will also need to add the following code to your wp-config.php file just below the WP_DEBUG line.
define( 'WP_DEBUG_LOG', true );
  • Save your Changes.
  • Now upload your wp-config.php file back to your website.
  • Now, visit your WordPress site and access the pages that were resulting in errors or warnings.
  • Later on, connect your website using an FTP client or file manager app on your WordPress hosting cPanel.
  • Once connected, go to /wp-content/ folder, here you will find a file called debug.log. This file consists of all WordPress errors, warnings, and notices that were logged.

You are done, this is how you can easily enable debug mode on your WordPress site and keep your website with zero errors.

You'll also like:
Continue to the category
Amit Malewar
Amit Malewarhttps://www.infophilic.com/
Amit Malewar has been the tutorial writer since 2013. His passion for helping people in all aspects of technology flow through the expert coverage he provides. In addition to writing for InfoPhilic, Amit loves to read and try new things.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

GET STARTED
DEALS

WPEngine Hosting

GET 5 MONTHS FREE
spot_img