What the WordPress Error Log Is (And How to Use It For Debugging Purposes)
Resolving WordPress issues can be daunting. This guide shows you a quick way to use the WordPress error log to find out what's wrong with your website.
As familiar with the errors, you are debugging them is the most time consuming and hardest thing if you are dealing with troubleshooting errors in WordPress such as the white screen of death, 502 bad gateway, WordPress error 500, WordPress Admin Login where you end up not finding what actually is causing the error and thus leads tasting your precious time and delay in traction of traffic to your site.
Now how about making things simpler? WordPress comes with amazing features such as debugging and WordPress error log tools that can make the tedious process a lot easier. If this was enabled by default, you would not be reading about it here. Since it is not you've got to know about, what is it? How cool does it work? And how it may help you? And of course, you need to enable it and to do so, one can either manually put hands on it or by way of plugins.
What is this Debugging and WordPress error log tool?
Isn't it so refreshing to have a built-in debugging feature that can keep track of the error log on your website? Well, this is an inbuilt debugging tool in the WordPress that keeps a trail of all the errors occurring on your website which in turn can allow you to have a look at it and know from where the root cause of this error is coming from.
Why should you consider it?
1. Troubleshooting the errors: In a couple of minutes by looking at this log know the source from which the errors are arising rather than trying all the troubleshooting methods to come to the solution.
2. It interests the root cause: Know directly which file is defective if you aren't aware. Want more clarity? It can show the snippet of code that maybe needs to be changed.
Comprehending the WordPress error log is quite hard as it shows up things in the form of PHP parlance. If you are handy in this then well, it's for you. If not, it still aids you with the information about the defective files that you need to glance at for which Google fix can be incorporated if you know what it is. Each line to line in the log will tell what error is right here.
Now how about enabling it? Liked the feature of WordPress debug mode? Head over to know how to do so.
As you are aware by now that this feature is not enabled for it to auto-detect and is somewhere hidden. Now let's hunt for it.
If you are a 000webhost user, then you are not allowed to have debugged mode while in other host services you have this mode all for yourself. Now being a 000webhost user, how do you enable this feature might be the question.
Well, one of the WordPress kernel files being wp-config.php can be tweaked to turn on this mode of debugging. The website can easily connect to the database through this. Since to access the wp-config.php file, one must have FTP client and few credentials to log in. Now for 000webhost one can find the necessary details by logging into the account and there go to the Settings and from there head over to General, there one can FTP details. And while for the credentials, one requires the Name of the host, Username obviously aligns with the Password.
With those details in hand, download the FTP client. Filezilla is the good one to go for. For Filezilla to set the connection, one must download the file, install it, and run it. Fill the details in the respective sections with the features you already have while you launch Filezilla. With this FTP connection is set with the website. This allows you to transfer a file, access them, and edit them as well. Our concern here is to find the root folder named public_html amongst the newly appeared data in the Filezilla.
This file has everything related to your setup of WordPress, so try not to mess with it. Once that file is located open it and locates a wp-config.php file inside it. Right-click on this folder and you see the options of edit or view and choose the good editor you may want. Once done scroll to look for /* That's all, stop editing! Happy blogging. */ this code of line. The reason to look for this is to include a snippet of code before this line. And that is given below,
define( 'WP_DEBUG', true );
Include this in the program. Close this by saving the changes in wp-config.file. And now is when Filezilla asks if you need to overwrite. Click, yes, and you are steady to move further.
Now is to access the debug file.
In the public_html file, you can see the wp-config.php file which will only have one directory, and that's debug.log file. Once opened, don't bother about the way the code which you don't understand. We only are worried about the timestamps and well the data wherever each event directs to.
Let's say there is a fatal error and one without PHP knowledge can still identify the file that causes the error and look for how to fix some of the particular mistakes in Google. If you have the experience, strive to debug it.
Another alternative for accessing the wp-config.php file is through the plugin. Let's look at it…
A plugin named Error log Monitor lets you check out the debug.log file from the Dashboard itself. Now how do you use the plugin?
Go to the Plugin section and head over to Add new tab and type the Name of this plugin in the search. Once found, click to Install Now and if it's done, activate it. One can see the PHP log error widget on the Home page of the Dashboard. This allows you to see the 20 lines of the debug log file, avails you with the timestamp for the errors, and also lets you clear the file on a click.
Another choice of the plugin is the WP Security Audit Log plugin, which allows you to keep track of various events but not the individual errors like in debug mode. So, this enables you to view more events. It's a good idea to have both debug mode and the WP Security Audit Log plugin to keep track of the gs on the background of your website.
Though debugging is hard of a thing, Wordpress error Log file makes its way for easier comprehension of the root cause of the errors in the simplest way, regardless of knowing PHP, a tool can still direct you to know the defective files in the WordPress to rectify it by troubleshooting methods for specific errors viewed in various sources of Google.