Customize wordpress error log using wp-config file
Do you want to learn how to configure the error log in the wp-config file? This file controls not only the general settings for connecting to the database, but also is a powerful debugging tool that helps you find and fix errors. In this article, we will show you how to configure error logs in the wp-config.php configuration file. Let's go!
Click here : Website Designing Services UAE
The wp-config configuration file, as we said above, contains important WordPress settings. These settings tell the site how to connect to the database, which table prefix to choose, generates authentication keys to make your site more secure.
To learn more about it, read our article how to edit the wp-config.php file in WordPress
In addition to the default settings, this file can also be used to determine some other parameters. It can also enable debug mode and save a WordPress error log.
This will help you find WordPress errors by indicating which scripts or plugins cause them. Let's see how to enable it.
First, you need to edit this file. You can access it by connecting using the FTP client or the file manager application in the cPanel hosting panel
In the root structure of all files, find it and open it in any preferred text editor of the code and find a line called so: “That's all, stop editing! Happy blogging. "(That's all! Editing is complete. Happy blogging! - something like that can be translated)
Before this line, add the following code:
define( 'WP_DEBUG', true );
1
define( 'WP_DEBUG', true );
Perhaps this code is already in your file and is false. In this case, you need to replace it with true.
Only this line will enable WordPress debugging mode. However, the disadvantage of this debugging is that you will see WordPress errors and warnings inside your administration area (admin panel), as well as the first page (main) of your site.
If you want errors to be logged, you should also add this code just below the wp_debug line
define( 'WP_DEBUG_LOG', true );
1
define( 'WP_DEBUG_LOG', true );
Do not forget to save the changes and upload the wp-config.php file to your website.
To get started, you need to visit the WordPress website and access pages that lead to errors or warnings. After that, you will need to connect to your web site using the FTP client application or file manager.
Then go to the / wp-content directory and inside it you will find the debug.log file
You can download, view or edit it. Inside it will contain all the entries of the error log, warnings, notifications that have been registered.
I also recommend that you read the article about hacks and chips of the .htaccess file
For more information visit our website Digital Marketing Services in UAE