Do you wish to Set Up Error Logs of WordPress in WP-Config? The wp-config file in WordPress is useful debugging tool for helping you to find and fix the errors. In this article, we will show you how to set up WordPress error logs in the wp-config file so read the whole article carefully.
Why and When You Require to Set up WordPress Error Logs in WP-Config
The wp-config.php file is a WordPress configuration file that includes necessary WordPress settings. These settings tell your website how to connect to your WordPress database, which database table prefix to use, and develops authentication keys to make your WordPress site more secure.
Aside from default WordPress settings, wp-config file can also be used for defining various other parameters.Wp-config file can enable WordPress debugging mode and save WordPress error logs.
This guides you to find WordPress errors by finding the plugin that are causing them. You can then find a solution for those WordPress errors. Where, plugin is defined as a type of software that contains a group of functions that can be added to a WordPress website. They are used to provide additional functionality to your application.
Let’s see how to enable and setup WordPress error logs in wp-config file.
Setting WordPress Error Logs in WP-Config File
- Edit your wp-config.php file. You can also access it by connecting to your site via File Manager app or FTP client in cPanel.
You will see wp-config.php file in the root directory of your website. Just open the file in any text editor and add the following code:
define( ‘WP_DEBUG’, true );
- It is possible that this code is present in your wp-config.php file and is set to false. Just change it to true.
- This line will turn on WordPress debug mode. But the drawback of using this debugging itself is that you will see WordPress errors and warnings inside your admin area as well as on front page of your website.
- If you want errors to be logged, then you will also need to add the following code in your wp-config.php file at below the WP_DEBUG line.
Here, admin area is also known as the administration area in WordPress website where only an authenticated user can make changes. In other words, it allows you to create and manage posts, pages, menus, media, change styling in the form of themes, add functionality in the form of plugins, and much more.
define( ‘WP_DEBUG_LOG’, true );
At last save your changes and upload your wp-config.php file back to your site.
Reviewing Your WordPress Error Logs
For this Visit your WordPress site and access the pages that were in errors or warnings. Using a FTP client or file manager app in your WordPress hosting cPanel connect to your website.
FTP stands for File Transfer Protocol. It is a “means of transport” i.e it is used to transfer files from one local computer to a remote website, such as a WordPress blog. It is also used to download files from your WordPress website to your computer or to change files and directories permissions on a remote website.
Also, cPanel is also known as control panel which is basically a web hosting panel based on Linux system and provided by many hosting providers. It provides a website all the automation tools to simplify the process of hosting a website.
Once connected, go to /wp-content/ folder and inside it your will see a file called debug.log.
You can also download, view, or edit this file. It will contain all WordPress warnings, errors and notices that were logged.
The wp-config file in WordPress is useful debugging tool that helps in finding and fix the errors. We hope that this article helped you to Set Up wordpress error log wp-config.
In case of any help related to WordPress feel free to contact our wordpress customer service, dial + 1 844 275 0975(Toll-Free). We will help you instantly for resolving all your problems.