In this article, we will review how to access WordPress error logs for your website to assist in debugging a problem. There are a few locations that logs can be found – all need to be accessed through an SFTP connection.
Accessing WordPress Error Logs on Your Site
This error log file is automatically generated and can be accessed via SFTP. It is located above the site root, in a folder called /tmp. You will need to connect to the server via SFTP and then move up one directory (outside of the /htdocs directory) to find the /tmp folder.
You can enable a WordPress debug log through the wp-config.php file found via SFTP in your site root. You will need to edit wp-config.php and look for a line that reads:
define( 'WP_DEBUG', false );
Replace it with these three lines:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
Your debug.log file will then be generated within the /wp-content directory.
If your site includes a WooCommerce store, WooCommerce also generates its own logs within /wp-content/uploads/wc-logs. Those can be accessed through SFTP.