{"id":3123,"date":"2022-06-29T22:33:03","date_gmt":"2022-06-29T17:03:03","guid":{"rendered":"https:\/\/www.wpoven.com\/blog\/?p=3123"},"modified":"2023-09-16T22:35:40","modified_gmt":"2023-09-16T17:05:40","slug":"how-to-setup-and-use-wordpress-error-log","status":"publish","type":"post","link":"https:\/\/www.wpoven.com\/blog\/how-to-setup-and-use-wordpress-error-log\/","title":{"rendered":"How to Set up and Use WordPress Error Log?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">&nbsp;<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"justify\">When you develop the website, it is not a bad idea to control the possible errors or check other information the server replies to your queries. One of the best ways to do that is to set up and read the WordPress logs. In the article, we are going to explain what are the types of log files, and how to set them up on different servers and read them to analyze the different aspects of your website.<\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_30aa7515-1a4a-43e1-83c7-cd8f86e0d1a7\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_a82f7894-5881-4d5d-93e6-ae0be645871e\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<div class=\"wp-block-group fre-pros-box is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"myh2 wp-block-heading\">How to set up WordPress Error Logs?<\/h2>\n\n\n<div class=\"wp-block-image imgsha round\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2018\/07\/wordpress_error_logs_1.png\"><img decoding=\"async\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2018\/07\/wordpress_error_logs_1.png\" alt=\"WordPress error log\" class=\"wp-image-3125\" title=\"\"><\/a><figcaption class=\"wp-element-caption\"><em><sup>WordPress error log<\/sup><\/em><\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">There are two main server types: <em>Apache<\/em> and <em>Nginx<\/em>. Let\u2019s see how to set up a WordPress error log for each of them.<\/p>\n\n\n\n<p class=\"justify\">Apache is a powerful open-source solution for web servers. The logging capabilities in Apache are very flexible. Most log setting options are applicable to any operating system, but some of them are specific only to Unix or Linux.<\/p>\n\n\n\n<p class=\"justify\">Apache by default is pretty well configured for logging one&#8217;s site. The standard <em>httpd.conf<\/em> file must have a section of logs with detailed comments for each directive. The default log directory is usually located in <em>\/etc\/httpd\/logs<\/em>. Now let&#8217;s look at the log settings section:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>ErrorLog logs\/error_log<br>LogLevel warn<br>LogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined<br>LogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %b\" common<br>LogFormat \"%{Referer}i -&gt; %U\" referer<br>LogFormat \"%{User-agent}i\" agent<br>CustomLog logs\/access_log combined<\/strong><\/code><\/p>\n<\/div><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_be487092-21ba-4608-9cea-6514597c8e88\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group box is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"myh2 wp-block-heading\">Apache WordPress Error Log<\/h2>\n\n\n\n<p class=\"justify\">The WordPress error log contains messages from Apache like errors, notifications, warnings, etc. This log is very useful for finding and fixing server-side problems. It is written in the site&#8217;s Apache config file usually placed in <em>\/etc\/apache\/sites-available\/&nbsp;<\/em>folder. Let\u2019s see how to set up it:<\/p>\n\n\n\n<p class=\"justify\">If you want to store all information about errors in one log, this directive will suffice. However, you can specify a WordPress error log file for each domain. This is done in the <em>&lt;VirtualHost&gt;<\/em> sections approximately as follows:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>&lt;VirtualHost 10.0.0.2&gt;<br>DocumentRoot \"\/home\/sites\/domain1\/html\/\"<br>ServerName domain1.com<br>ErrorLog \/home\/sites\/domain1\/logs\/error.log<br>&lt;\/VirtualHost&gt;<\/strong><\/code><\/p>\n\n\n\n<p class=\"justify\">If you are a system administrator or have root access to the server, you should be able to monitor these logs. We recommend using one file. And if you provide <a href=\"https:\/\/app.wpoven.com\/users\/signup\" data-type=\"URL\" data-id=\"https:\/\/app.wpoven.com\/users\/signup\" target=\"_blank\" rel=\"noopener\">hosting<\/a> for clients, it is more convenient to set a separate error log for each client so that they can track their errors.<\/p>\n\n\n\n<p>The level of errors entering the log is set as follows:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Types of Errors<\/strong><\/h3>\n\n\n\n<p>The following error levels are defined in Apache:<\/p>\n\n\n\n<ul>\n<li><em>emerg<\/em> \u2014 emergency &#8211; the system does not function;<\/li>\n\n\n\n<li><em>alert<\/em> \u2014 the error must be immediately corrected;<\/li>\n\n\n\n<li><em>crit<\/em> is a critical error;<\/li>\n\n\n\n<li><em>error<\/em>;<\/li>\n\n\n\n<li><em>warn<\/em> \u2014 warning;<\/li>\n\n\n\n<li><em>notice<\/em> \u2014 notification (normal operation);<\/li>\n\n\n\n<li><em>info<\/em> \u2014 information message;<\/li>\n\n\n\n<li><em>debug<\/em> \u2014 debug message.<\/li>\n<\/ul>\n\n\n\n<p class=\"justify\">Keep in mind that all subsequent levels include previous ones. That is if we set the <em>warning<\/em> level, the log will get errors from the following classes: <em>emerg, alert, crit, error, and warn<\/em>.<\/p>\n<\/div><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_1429a4be-a556-4f24-97fe-ac4463457dc6\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group box is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"myh2 wp-block-heading\">WordPress Error Log Nginx<\/h2>\n\n\n\n<p class=\"justify\">Log files are the first place to look for errors. Especially if it relates to a web server. In Nginx, there are only two main logs: <em>error log<\/em> and <em>access log<\/em>.<\/p>\n\n\n\n<p class=\"justify\">Logging of the Nginx errors occurs in a specific file, stderr, or Syslog. It collects all the errors that occurred during the operation of the webserver. By default, it is enabled globally:<\/p>\n\n\n\n<p class=\"justify\">To log only certain errors, you need to place a directive in the HTTP, server, stream, or location section. And so you can only log critical errors and alarms<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Nginx: Types of logs<\/strong><\/h3>\n\n\n\n<p class=\"justify\"><strong>An error log<\/strong> is very useful when debugging site issues, configuring new plugins, and installing themes. So, for example, if you see a <a href=\"https:\/\/www.wpoven.com\/blog\/how-to-fix-wordpress-white-screen-of-death-error\" target=\"_blank\" rel=\"noreferrer noopener\">&#8220;White Screen of Death&#8221; Error<\/a> when you open your site, the first thing to do is to open an error log for this site in your account. The error log is the most optimal way to monitor and detect errors when working or configuring a site.<\/p>\n\n\n\n<p class=\"justify\">The <strong>A<\/strong><strong>ccess log<\/strong> shows the IP addresses and which URL has been accessed, along with a timestamp for each domain. This can be useful for the detection and analysis of third-party log analyzers and for identifying security issues like DDOS attacks.<\/p>\n\n\n\n<p class=\"justify\">Next, remember that the logs are included in the total quota of disk space for the account. If you have little space on your server, then you need to periodically clean these logs or turn them off.<\/p>\n\n\n\n<p class=\"justify\">With the correct operation of the site (without errors) and a small number of visitors, your logs will be small. That&#8217;s why you can clean them periodically if there is not enough disk space.<\/p>\n\n\n\n<p class=\"justify\">But there are cases when the error log or the access log becomes very large. The error log can be large in size if some script does not work correctly and every time it is accessed, an error occurs that is noted in the log \u2014 such a log will have many entries and, accordingly, a large size.<\/p>\n\n\n\n<p class=\"justify\">The access log can be of a large size if a site is under attack like a DDoS \u200b\u200battack.<\/p>\n<\/div><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_807be6d4-390f-4c04-8785-c550beeb8603\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">How to enable WordPress Error logs (Nginx)<\/h2>\n\n\n\n<p class=\"justify\">In order to enable a dedicated and separate Error and Access log for a single site, we need to add the following code in its Nginx site config file. This file is usually present in the &#8216;\/<em>etc\/nginx\/sites-available\/<\/em>&#8216; folder.<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>access_log \/srv\/www\/test.com\/logs\/access.log;<br>error_log \/srv\/www\/test.com\/logs\/error.log;<\/strong><\/code><\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_742dad6c-d07c-4ea7-a5a5-2ef51f1d201d\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group tip is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"myh2 wp-block-heading\">How to enable logs using wp-config.php<\/h2>\n\n\n\n<p class=\"justify\">The wp-config file contains basic parameters and settings for your site on WordPress. It stores such important data as connection settings to the database, a prefix for the database tables, and an address for logging into the admin area if WordPress is installed in a subdirectory.<\/p>\n\n\n\n<p class=\"justify\">But in addition to the basic settings, wp-config can also be used to set other parameters. For example, you can enable debugging mode (<em>wp_debug<\/em>) and write all the received data to the error log. In most cases, this helps to identify and fix problems on the site.<\/p>\n\n\n\n<p class=\"justify\">First of all, you need access to the wp-config.php file itself. The file is located in the root directory of WordPress, and in order to edit it, we need an FTP client or File Manager if you have access to cPanel.<\/p>\n\n\n\n<p class=\"justify\">Open the file wp-config.php and find there the line <em>&#8220;That&#8217;s all, stop editing! Happy blogging.&#8221;<\/em><\/p>\n\n\n\n<p>Just before this line, add a new line of code:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>define ('WP_DEBUG', true);<\/strong><\/code><\/p>\n\n\n\n<p class=\"justify\">Perhaps this line is already present in the file with the &#8220;<em>FALSE&#8221;<\/em> value. In that case, you do not need to duplicate it, just change <em>FALSE<\/em> to <em>TRUE<\/em>.<\/p>\n\n\n\n<p class=\"justify\">With this code, you will enable WordPress to debug mode. Be ready that WordPress will display all warnings and errors on the site at the top of the page, both in the admin panel and on the site itself.<\/p>\n\n\n\n<p class=\"justify\">Therefore, the general recommendation is not to leave debug mode on permanently, use it only when necessary.<\/p>\n\n\n\n<p class=\"justify\">Now, in order to additionally include the record of all detected errors and warnings in the log file, add one more line of code in the same wp-config file, just below the line with WP_DEBUG:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>define ('WP_DEBUG_LOG', true);<\/strong><\/code><\/p>\n<\/div><\/div>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_e187d868-b998-4c39-8caf-f1d8eb0fa099\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">How to view WordPress Error logs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>From command line<\/strong><\/h3>\n\n\n\n<p class=\"justify\">To view the logs from the SSH console or command line, we will use the &#8216;<em>tail<\/em>&#8216; command in this example.<\/p>\n\n\n\n<p class=\"justify\"><em>The tail<\/em> command allows you to view the last 10 lines of the file, in this case, the error or access log.<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>tail&nbsp; \/srv\/www\/test.com\/logs\/error.log<\/strong><\/code><\/p>\n\n\n\n<p class=\"justify\">In case you need to see more number of lines, For example, 25, then we can use the &#8216;n&#8217; flag :<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>tail -n 25&nbsp; \/srv\/www\/test.com\/logs\/error.log<\/strong><\/code><\/p>\n\n\n\n<p>Or the following way:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>tail -25 \/srv\/www\/test.com\/logs\/error.log<\/strong><\/code><\/p>\n\n\n\n<p class=\"justify\">The second useful parameter that you can pass is -f. With this parameter, the tail displays the specified number of last lines and continues to read the lines to add, until you press <em>Ctrl+C<\/em>.<\/p>\n\n\n\n<p class=\"justify\">It means that you can live-track the changes in the log file. This is particularly helpful when trying to pinpoint the exact URL which is causing the error. You can reload the page and see exactly which errors it is throwing :<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>tail -5f \/srv\/www\/test.com\/logs\/error.log<\/strong><\/code><\/p>\n\n\n\n<p>Here is a sample output for a tail command:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>2018\/07\/07 10:34:21 [error] 11738#11738: *128307 FastCGI sent in stderr: \"PHP message: PHP Warning: json_decode() expects parameter 1 to be string, array given in \/srv\/www\/test.com\/public_html\/wp-content\/plugins\/wpbase-cache\/wpbase-cache.php on line 74\" while reading upstream, client: 124.40.251.253, server: test.com, request: \"POST \/wp-admin\/plugins.php?plugin_status=all&amp;paged=1&amp;s HTTP\/1.1\", upstream: \"fastcgi:\/\/127.0.0.1:9000\", host: \"test.com\", referrer: \"https:\/\/test.com\/wp-admin\/plugins.php?plugin_status=all&amp;paged=1&amp;s\"<br><br>2018\/07\/10 02:12:44 [error] 29169#29169: *16240 FastCGI sent in stderr: \"PHP message: PHP Fatal error: Out of memory (allocated 14680064) (tried to allocate 4096 bytes)  in \/srv\/www\/test.com\/public_html\/wp-content\/plugins\/jetpack\/class.jetpack.php on line 2097\" while reading response header from upstream, client: 185.85.191.201, server:  test.com, request: \"GET \/wp-login.php HTTP\/1.1\", upstream: \"fastcgi:\/\/127.0.0.1:9000\", host: \"test.com\"<br><br>2018\/07\/10 07:01:31 [error] 32488#32488: *2605 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 66.249.79.10, server:  test.com, request: \"GET \/mlebusik\/?action=lostpassword HTTP\/1.1\", upstream: \"fastcgi:\/\/127.0.0.1:9000\", host: \"test.com\"<br><br>2018\/07\/11 03:59:43 [error] 10455#10455: *27706 FastCGI sent in stderr: \"PHP message: PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 16384 bytes) in  \/srv\/www\/test.com\/public_html\/wp-includes\/general-template.php on line 1507\" while reading response header from upstream, client: 66.249.79.31, server: test.com, request:  \"GET \/robots.txt HTTP\/1.1\", upstream: \"fastcgi:\/\/127.0.0.1:9000\", host: \"test.com\"<\/strong><\/code><\/p>\n\n\n\n<p>Let&#8217;s breakdown one error log entry and see what it means:<\/p>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>2018\/07\/11 03:59:43 [error] 10455#10455: *27706 FastCGI sent in stderr: \"PHP message: PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 16384 bytes) in<br>\/srv\/www\/test.com\/public_html\/wp-includes\/general-template.php on line 1507\" while reading response header from upstream, client: 66.249.79.31, server: test.com, request:<br>\"GET \/robots.txt HTTP\/1.1\", upstream: \"fastcgi:\/\/127.0.0.1:9000\", host: \"test.com\"<\/strong><\/code><\/p>\n\n\n\n<ul>\n<li>2018\/07\/11 03:59:43\u2014 Timestamp, when the error occurred<\/li>\n\n\n\n<li>[error] \u2014Type &#8211; Error. This can also be a Notice, Warning, etc;<\/li>\n\n\n\n<li>&#8220;PHP Fatal error: Out of memory&nbsp; &#8230;.&#8221; \u2014 Error message;<\/li>\n\n\n\n<li>&#8220;66.249.79.31&#8221; \u2014 IP from where the request originated;<\/li>\n\n\n\n<li>[07\/Aug\/2013:23:04:22 +0000] \u2014 request date and time;<\/li>\n\n\n\n<li>GET \/robots.txt HTTP\/1.1 \u2014 the request;<\/li>\n\n\n\n<li>host: &#8220;test.com&#8221;&nbsp;\u2014 The Domain name;<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Apache Error Log Example :<\/strong><\/h3>\n\n\n\n<p class=\"round has-background\" style=\"background-color:#f0f0f0\"><code><strong>site.com [Sat May 31 12:07:10 2008] [error] [client 127.0.0.1] File does not exist: \/srv\/www\/test.com\/public_html\/favicon.ico<br>site.com [Fri Aug 05 13:50:37 2011] [alert] [client 127.0.0.1] \/srv\/www\/test.com\/public_html\/.htaccess: RewriteRule: cannot compile regular expression  '^edit_serv\/(.*):([0-9]{2,20}+)\/<\/strong><\/code><\/p>\n\n\n\n<p class=\"justify\">The logs include the domain name to which the request was registered, the time of the request, the IP address from which the access was made, and, directly, the error text.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>View WordPress Error log using FTP<\/strong><\/h3>\n\n\n<div class=\"wp-block-image imgsha round\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2018\/07\/wordpress_error_logs_2.png\"><img decoding=\"async\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2018\/07\/wordpress_error_logs_2.png\" alt=\"WordPress error log\" class=\"wp-image-3126\" title=\"\"><\/a><figcaption class=\"wp-element-caption\"><em><sup>WordPress error log<\/sup><\/em><\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"justify\">If you have an FTP user credential that has sufficient permissions to access the WordPress Error log and access log files, then you can simply log in using an FTP Client like FileZilla and then navigate to the Error log Directory and download it or open it directly in an editor of your choice.<\/p>\n\n\n\n<p class=\"justify\">The WordPress error log is a great way to control the website processes. How often do you use them?<\/p>\n\n\n\n<p class=\"justify\">The logs include the domain name to which the request was registered, the time of the request, the IP address from which the access was made, and, directly, the error text.<\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_023416c8-b848-4643-a56b-08050b67826d\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"justify\">The WordPress error log is a great way to control the website processes. It contains all the warnings and error messages your website has gone through. So you need to know how you can set up and access them from time to time.<\/p>\n\n\n\n<p class=\"justify\">However, if you have already set up WordPress error logs on your website, then How often do you use them? Do let us know in the comment section below!<\/p>\n\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_a54e144d-e133-49fe-8adb-856c2d195c9f\"><hr class=\"ub_divider\" ><\/hr><\/div>\n\n\n<p>Save your time, money, and resources, and give your website a mammoth growth with\u00a0<strong>WPOven\u2019s<\/strong>\u00a0<a href=\"https:\/\/www.wpoven.com\/agency-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Agency wordpress hosting<\/a>.<\/p>\n\n\n\n<ul>\n<li>24X7 WordPress Expert support<\/li>\n\n\n\n<li>Cloudflare integration<\/li>\n\n\n\n<li>High-end Security<\/li>\n\n\n\n<li>Datacentres around the world, etc.<\/li>\n<\/ul>\n\n\n\n<p>You can have all these features and much more in a single plan with unlimited Free migrations, unlimited staging, and a\u00a0<strong>14-day risk-free guarantee<\/strong>.\u00a0<a href=\"https:\/\/www.wpoven.com\/plans-and-features\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>Check out our plans<\/em><\/a>\u00a0or<strong>\u00a0<\/strong><a href=\"https:\/\/www.wpoven.com\/contact\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>Contact our support team<\/em><\/a>\u00a0that assist you in choosing the right plan.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block justify\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1648811674807\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>How do I find my WordPress error log?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>You can find WordPress error logs in the site&#8217;s Apache config file usually placed in <em>\/etc\/apache\/sites-available\/\u00a0<\/em>folder or you can go to File Manager and look out for the wp-content folder and locate the debug.log file.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1648812065865\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>What is WordPress error log?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Error logs are generally a collection of all the tracks and records that contains possible error reports and information the server replies to your queries.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1648812260769\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>How do I create a WordPress error log?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>1. First you need to access the wp-config.php file itself. The file is located in the root directory of WordPress.<br \/>2. And in order to edit it, we need an FTP client or File Manager if you have access to cPanel.<br \/>3. Open the file wp-config.php and find there the line <em>&#8220;That&#8217;s all, stop editing! Happy blogging.&#8221;<\/em><br \/>4. Just before this line, add a new line of code:<br \/>define (&#8216;WP_DEBUG&#8217;, true);<br \/>5. Perhaps this line is already present in the file with the &#8220;<em>FALSE&#8221;<\/em> value. In that case, you do not need to duplicate it, just change <em>FALSE<\/em> to <em>TRUE<\/em>.<br \/>6. Now WordPress will display all warnings and errors on the site at the top of the page, both in the admin panel and on the site itself<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n<div class=\"wp-block-ub-divider ub-divider-orientation-horizontal\" id=\"ub_divider_908d4375-4775-4efa-840c-f566e5dd7c83\"><hr class=\"ub_divider\" ><\/hr><\/div>","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n<p>Introduction<\/p>\n<p>When you develop the website, it is not a bad idea to control the possible errors or check other information the server replies to your queries. One of the best ways to do that is to set up and read the WordPress logs. In the article, we are going to explain what are the types of log files, and how to set them up on different servers and read them to analyze the different aspects of your website. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.wpoven.com\/blog\/how-to-setup-and-use-wordpress-error-log\/\" class=\"more-link\">Read More <i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><span class=\"screen-reader-text\"> &#8220;How to Set up and Use WordPress Error Log?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":20771,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[11,13,21],"acf":[],"featured_image_src":"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/06\/WordPress-Error-Log.png","author_info":{"display_name":"Vikrant Datta","author_link":"https:\/\/www.wpoven.com\/blog\/author\/vikrant\/"},"_links":{"self":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/3123"}],"collection":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/comments?post=3123"}],"version-history":[{"count":3,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/3123\/revisions"}],"predecessor-version":[{"id":22849,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/3123\/revisions\/22849"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/media\/20771"}],"wp:attachment":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/media?parent=3123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/categories?post=3123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}