Port to the world of technology

How to Set Up WordPress Error Logs in WP-Config

0

 

Howdy WordPress users!! How are you doing? Today I came up with another troubleshooting article for WordPress. To help you with setting up WordPress error logs in the wp-config file. As you may know already the wp-config file in WordPress controls your site settings and also helpful debugging tools to find and fix errors.

Why and when you need to set up WordPress error logins in wp-config?

Let us start with the basics. The wp-config.php file is a WordPress configuration file that has important WordPress settings. The purposes of those settings are connecting to your WordPress database, selecting the database table prefix, and generating authentication keys to secure your WordPress site. You can read more about the wp-config file, in our article on how to edit the wp-config file in WordPress.

Other than default WordPress settings, the wp-config file can be used for other purposes also. As an example, it can enable WordPress debugging mode and even save WordPress error logs. Additionally, this will help you to find WordPress errors while identifying the culprits causing them. So that you will be able to fix those errors accordingly.
Now, let’s get on to the main topic.

Setting up WordPress Error Logs in wp-config file

In order to edit the wp-config.php file. First, you have to access it. You can do that by connecting to your website via an FTP client or File Manager app in cPanel.

Then you will see the wp-config.php file in the root directory. Next, open the file with any text editor and search for the line that says ‘That’s all, stop editing! Happy blogging.’
Add the following line just before this line.

define( 'WP_DEBUG', true );

In some cases, the code may be already there but in the wrong way. So you will have to change it as an example.
That simple thing will turn on debug mode by itself. But if you use the debugging alone, you will see WordPress errors and warnings inside your admin area and on the front page of your website even.

So to prevent the logging of errors you have to add the following code in the wp-config.php file just after the WP_DEBUG line.

define( 'WP_DEBUG_LOG', true );

finally, save the changes and upload the wp-content.php file to your website. 

Review your WordPress error logs

As the first step, you have to visit your WordPress site and access the pages that were causing errors and warnings. then connect to your website via an FTP client or file manager app in the WordPress hosting cPanel.

When connected, go to /wp-content/ folder. you will see a file named debug.log inside that.

That debug.log file contains all WordPress errors, warnings, and logged notices.

Therefore you can download, view, or edit that particular file.


Connect with us

We would like to hear about your problems, questions, and suggestions. So feel free to contact us. This is free of charge service that we offer. But we receive thousands of emails per day. So it is impossible to reply to all of them. So we create a Community to help you individually. Go to Community and open help Topic under the relevant category.  Please spread this post to your friends by sharing Facebook and other major social media. And make sure to like us on Facebook.

Leave A Reply