WooCommerce logs are your store’s diagnostic record. They capture errors, warnings, and key events like failed payments, API issues, and gateway problems. This guide shows you how to turn on logging, where the log files live, and how to interpret them so you can fix issues faster.
What You’ll Need
- A WordPress admin account with access to WooCommerce settings.
- FTP or cPanel File Manager access (only if you need to view raw log files directly).
- Basic understanding of your site’s file structure (optional but helpful).
Step-by-Step
- Log in to your WordPress dashboard. Go to WooCommerce → Settings.
- Open the Status tab. Click the Status tab at the top of the settings page, then select Logs from the sub-tabs.
- Enable logging (if not already on). By default, WooCommerce has logging enabled for most extensions. To confirm, check the Logging section. If you see a toggle or checkbox, make sure it’s turned on. Some extensions have their own log settings—check each plugin’s settings page if you don’t see a global toggle.
- Choose which logs to view. On the Logs screen, use the dropdown menu labeled Log to select a specific log file (e.g.,
fatal-errors,woocommerce-gateway-paypal, or a date-stamped file). - Click “View”. This will display the last 100 lines of that log file in a scrollable text area.
- Search within the log. Use your browser’s find function (Ctrl+F or Cmd+F) to search for keywords like “error”, “fatal”, “failed”, or a specific product ID.
- Download or copy the log. If you need to share it with support, click the Download button or copy the text and paste it into a support ticket.
- For raw file access (optional): Connect to your site via FTP or open cPanel File Manager. Navigate to
/wp-content/plugins/woocommerce/logs/(older versions) or/wp-content/uploads/wc-logs/(newer versions). Download the relevant.logfile.
Common Mistakes
- Disabling logging to “speed up” the site. Logging has minimal performance impact and is invaluable for debugging. Keep it on unless you have a specific reason.
- Looking at the wrong log. Each extension creates its own log. If you’re troubleshooting a payment issue, look for the gateway’s log (e.g.,
woocommerce-gateway-stripe), not the generalfatal-errorslog. - Ignoring log rotation. Logs can grow large. WooCommerce automatically rotates them, but if you manually edit or delete a log, the system may recreate it with a new timestamp.
- Assuming all logs are in English. Logs may contain code snippets, stack traces, and technical jargon. Don’t panic—look for the actual error message near the top.
- Forgetting to clear logs after a fix. Old errors can clutter the log and make it hard to spot new issues. Use the Clear button after resolving a problem.
Tips
- Enable logging for specific gateways. For example, in PayPal or Stripe settings, there is often a checkbox like “Enable Logging”. Turn it on when troubleshooting.
- Use the search filter. The Logs screen has a search box that lets you filter by date or keyword. This is faster than scrolling through hundreds of lines.
- Check the log after a failed action. Reproduce the error once, then immediately check the log. The most recent entries are at the bottom.
- Keep a copy of logs before clearing. If you’re about to clear a log, download it first—you might need it later for comparison.
- Use a log viewer plugin. If you work with logs often, a plugin like “WP Log Viewer” can make reading logs easier, but the built-in tool is sufficient for most tasks.
Troubleshooting
No logs appear: If the Logs screen is empty, logging might be disabled globally. Check WooCommerce → Settings → Status → Logs and ensure the toggle is on. Also, some hosts disable file writing; contact your host if you see a “cannot write” error.
Log file is huge: Large logs can slow down the page. Use the Clear button to empty it, or download and delete the file via FTP. WooCommerce will create a new one when needed.
Logs are not being created: This often happens when the wp-content/uploads directory is not writable. Check file permissions (should be 755 for directories, 644 for files). Also, ensure that the wc-logs folder exists—if not, create it manually.
You see “Permission denied” when downloading: This is usually a host-level restriction. Try downloading via FTP instead, or ask your host to grant access.
Log shows a fatal error but you don’t understand it: Copy the exact error message and search for it online or paste it into a support forum. Often, the error includes a file path and line number that points to the culprit plugin or theme.
Logs are not updating: If you’ve made a change and the log doesn’t reflect it, clear your browser cache and refresh the Logs page. Also, ensure you’re looking at the correct date—logs are often named with a date stamp.
Frequently Asked Questions
Q: Where are WooCommerce logs stored?
A: By default, logs are stored in /wp-content/uploads/wc-logs/ (or /wp-content/plugins/woocommerce/logs/ in older versions). You can access them via FTP or the Logs screen.
Q: How do I enable logging for a specific payment gateway?
A: Go to the gateway’s settings (e.g., WooCommerce → Settings → Payments → Stripe) and look for a “Logging” or “Debug” option. Enable it and save changes.
Q: Can I delete WooCommerce log files?
A: Yes, you can delete them manually via FTP or use the Clear button on the Logs screen. They are safe to delete; WooCommerce will recreate them as needed.
Q: Why do logs show errors but my site works fine?
A: Not all errors are critical. Some are warnings or notices that don’t affect functionality. Look for “Fatal error” or “Exception” to identify serious issues.
Q: How long are logs kept?
A: WooCommerce keeps logs for 30 days by default, then automatically deletes them. You can change this in wp-config.php by adding define('WC_LOG_HANDLER', 'WC_Log_Handler_DB'); or adjusting the retention period with a filter.
Q: What does “WC_Log_Handler_File” mean?
A: That’s the default log handler that writes logs to files. If you see “DB” instead, logs are stored in the database—you can view them under WooCommerce → Status → Logs as well.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Turn Off Backup Encryption in iTunes?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It