How to use WordPress Logs to Track Errors?
Last updated on June 19th, 2020
We all wish that our WordPress website works smoothly. But that is far from reality. There are times we face glitches or worst case our site goes down. Do not panic, we have got you covered! The first step to begin is to track the error. For which you need WordPress logs.
Logs play an important role when you are Troubleshooting and Debugging errors on your WordPress site. Or more accurately it tells why these errors occurred.
It is the detailed collection of data and updates that happened on your website. WordPress logs maintain full track of errors and record them on an easy to navigate the file.
Let’s say, for instance, you will find about who logged in and out, who updated a post when was a plugin installed and more. For each recorded update in the WordPress audit trail, the time and date of when the incident occurred, and the IP address from where the user came will also be present.
In this blog, we will show you how you can use WordPress logs to track your errors and resolve them.
THREE STEPS TO ENABLE WORDPRESS ERROR LOGS
- Update or edit wp-config.php file.
- File access using FTP.
- Find Your Updated WordPress Logs.
WHY YOU NEED ERROR LOGS IN WORDPRESS?
Every Software user faces some errors, no software is perfect. So, there might be some instances when you face problems with WordPress. Some of the problems users face are due to installing the platform with lots of themes, and plugins and this causes unforeseen issues.
Many sites which are available will assist you when you face bugs and errors. But in order to get some help first, you need to know what are these errors. So, that you can troubleshoot and mitigate these bugs. For troubleshooting and tracking errors, you need to enable WordPress logs.
ENABLING WORDPRESS LOGS IN 3 STEPS TO TRACK WEBSITE ERRORS
WordPress has “the Debugging mode” which is an error log functionality. By default, it is turned OFF. Let’s take a look at how to activate and use the WordPress log.
Before going through all the points make sure you made a backup of your website. As backup ensures a way to restore your website back.
ACCESS YOUR WEBSITE’S FILES USING FTP
You will need direct access to the site’s files to activate WordPress logs. To do this there are many different methods but we recommend File Transfer Protocol (FTP). It gives you permission to log directly into your site. So, that you can do the adding, deleting anytime when the need arises.
Example for FTP tool- the FileZilla client.
After installing FileZilla, you will need to enter FTP credentials to access the site. These are provided and can be found by your web host and in your control panel respectively.
After entering all the requirements. You just need to enter the Password, Username, and, Hostname, then click on the QUICKCONNECT option for further procedure.
UPDATE YOUR WP-CONFIG.PHP FILE
In this option, you need to enable the WordPress error log in your wp-config.php. first of all, connect your site through SFTP. Then download wp-config.php. Make the backup of the wp-config.php so that you can restore it anytime.
define (‘WP_DEBUG_LOG’, true);
The above codes are needed to be added or edited in your wp-config.php file.
In most of the WordPress installation WP_DEBUG is set to false. So, you need to change this value to True and it’s not common that WP_DEBUG_LOG is set in the wp-config that’s why you need to add this line.
Set both WP_DEBUG AND WP_DEBUG_LOG to true and make sure each constant is only defined once.
FIND YOUR UPDATED WORDPRESS LOGS
Your website’s WordPress logs are ready now.
Your new error log isn’t going to find problems that have occurred in the past. Hence, if you’re troubleshooting a specific issue, you’ll have to initiate it again by interacting with the element or performing the action that made it happen in the first place. This will prompt WordPress to log the error.
By logging into the site, you can find these errors using FTP.
- Navigate the root folder,
- Go to the wp-content folder,
- And search for a new file called debug.log:
if you will open these it will list a lot of errors and other issues that you faced in the past since activation of your WordPress site.
At this moment you have a few options. If you are techy, you can figure it out on your own and fix it. In some cases, the WordPress log might help regarding the errors, such as naming the element at fault or causing a fault.
If you need some help, you can take a look at the WordPress Forums.
When some error occurs WordPress, logs come to tackle the issue and pinpoint the source of error.
After you have solved your problem, you can turn off your WordPress blogs. Whereas, if you’re still facing issues finding solutions to your errors, you can get in touch with our WordPress technical support team to get off the hook. The team will help you tackle your WordPress problems in a way that makes you feel they never existed in the first place. So, get in touch today
Questions about how to use WordPress logs to troubleshoot errors on your site? Ask below.