{"id":11749,"date":"2026-07-06T12:35:00","date_gmt":"2026-07-06T17:35:00","guid":{"rendered":"https:\/\/infiniteuploads.com\/?post_type=docs&#038;p=11749"},"modified":"2026-07-06T12:35:00","modified_gmt":"2026-07-06T17:35:00","password":"","slug":"enabling-debug-logging-with-wp-config-defines","status":"publish","type":"docs","link":"https:\/\/infiniteuploads.com\/docs\/developers\/enabling-debug-logging-with-wp-config-defines\/","title":{"rendered":"Enabling Debug Logging with wp-config Defines"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p class=\"wp-block-paragraph\">Infinite Uploads includes several optional debug defines that write detailed diagnostic logs about what the plugin is doing behind the scenes. They're meant for troubleshooting a specific problem, such as a failing connection, a slow sync, or another plugin making excessive cloud storage requests, and answering our support team's questions with real data instead of guesswork.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These are developer and support tools. Turn them on only while you're chasing a problem, then <strong>turn them back off<\/strong>, since the more verbose options add overhead to every request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"before-you-start-where-the-logs-go\">Before You Start: Where the Logs Go<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All of these defines write to PHP's error log using&nbsp;<code>error_log()<\/code>. They don't create a log file on their own, so you first need somewhere for that output to land.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The simplest option is WordPress' own debug log. Add these to&nbsp;<code>wp-config.php<\/code>&nbsp;<strong>above<\/strong>&nbsp;the&nbsp;<code>\/* That's all, stop editing! Happy publishing. *\/<\/code>&nbsp;line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_DEBUG', true );\ndefine( 'WP_DEBUG_LOG', true );    \/\/ writes to wp-content\/debug.log\ndefine( 'WP_DEBUG_DISPLAY', false ); \/\/ keep errors out of the page output<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With those in place, everything below is written to&nbsp;<code>wp-content\/debug.log<\/code>. If&nbsp;<code>wp-content<\/code>&nbsp;isn't writable, or your host pins the log location, the entries will instead go to your server's PHP error log, which you can usually view from your hosting control panel.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong>&nbsp;<code>WP_DEBUG_LOG<\/code>&nbsp;only redirects the log to&nbsp;<code>wp-content\/debug.log<\/code>&nbsp;when&nbsp;<code>WP_DEBUG<\/code>&nbsp;is also&nbsp;<code>true<\/code>. Setting it on its own won't produce the file.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"cloud-api-logging\">Cloud API Logging<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"infinite-uploads-api-debug\">INFINITE_UPLOADS_API_DEBUG<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Logs every call the plugin makes to the Infinite Uploads cloud API, along with each step of a sync. This is the first define to reach for when a site won't connect, a sync stalls, or storage and bandwidth numbers look wrong.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'INFINITE_UPLOADS_API_DEBUG', true );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sample output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[INFINITE_UPLOADS API call] 3.2.5 | GET: https:\/\/api.infiniteuploads.com\/v1\/site (200)[INFINITE_UPLOADS Sync Debug] 3.2.5 Fetch S3 files from directory to download &gt;&gt; Step 1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"infinite-uploads-api-debug-all\">INFINITE_UPLOADS_API_DEBUG_ALL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Extends&nbsp;<code>INFINITE_UPLOADS_API_DEBUG<\/code>&nbsp;by adding the full request options and the complete response headers and body to each API log line. Use it when an API call is returning something unexpected and you need to see the raw response, not just the status code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'INFINITE_UPLOADS_API_DEBUG', true );\ndefine( 'INFINITE_UPLOADS_API_DEBUG_ALL', true );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is very verbose and will log full API responses. Enable it only briefly, and disable it as soon as you've captured what you need.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"cloud-storage-stream-wrapper-logging\">Cloud Storage (Stream Wrapper) Logging<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Infinite Uploads serves your uploads through an&nbsp;<code>iu:\/\/<\/code>&nbsp;stream wrapper, so any file operation another plugin performs on the uploads folder becomes a cloud storage request. These defines make those requests visible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"infinite-uploads-sw-debug\">INFINITE_UPLOADS_SW_DEBUG<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Logs every cloud storage operation the stream wrapper performs (listing a directory, checking whether a file exists, reading an object, and so on). At the end of each request it also writes a summary of the total number of calls and a breakdown of&nbsp;<strong>which plugin triggered them<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the define to use when a site is slow or hanging and you suspect a plugin is making too many cloud storage requests.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'INFINITE_UPLOADS_SW_DEBUG', true );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sample output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[INFINITE_UPLOADS Stream Debug] ListObjects 2025\/06\/\n[INFINITE_UPLOADS Stream Debug] doesObjectExist 2025\/06\/photo.jpg\n[INFINITE_UPLOADS Stream Debug] Stream wrapper API calls in 2.13s: {\"total\":47,\"commands\":{\"ListObjects\":12,\"HeadObject\":35}}\n[INFINITE_UPLOADS Stream Debug] Stream wrapper API calls by plugin: {\"example-plugin\":{\"total\":40,\"commands\":{\"HeadObject\":35,\"ListObjects\":5}}}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the example above,&nbsp;<code>example-plugin<\/code>&nbsp;is responsible for 40 of the 47 cloud calls in a single page load, which points straight at the source of the slowdown.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"infinite-uploads-sw-debug-backtrace\">INFINITE_UPLOADS_SW_DEBUG_BACKTRACE<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Adds a full stack trace to each stream wrapper log line, so you can see exactly which code made the call. Use it together with&nbsp;<code>INFINITE_UPLOADS_SW_DEBUG<\/code>&nbsp;when the per-plugin summary tells you&nbsp;<em>which<\/em>&nbsp;plugin is responsible but you need to know&nbsp;<em>where<\/em>&nbsp;in that plugin the calls originate.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'INFINITE_UPLOADS_SW_DEBUG', true );\ndefine( 'INFINITE_UPLOADS_SW_DEBUG_BACKTRACE', true );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This define has no effect on its own;&nbsp;<code>INFINITE_UPLOADS_SW_DEBUG<\/code>&nbsp;must also be enabled. It's the most verbose option available, so use it for short, targeted reproductions only.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"infinite-uploads-sw-debug-cache\">INFINITE_UPLOADS_SW_DEBUG_CACHE<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Logs the stream wrapper's internal object cache activity (hits, misses, and writes). This is a niche define, useful when investigating why the same file appears to be looked up in the cloud repeatedly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'INFINITE_UPLOADS_SW_DEBUG_CACHE', true );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sample output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[INFINITE_UPLOADS Stream Cache] HIT 2025\/06\/photo.jpg\n[INFINITE_UPLOADS Stream Cache] MISS 2025\/06\/banner.png<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"reading-the-log\">Reading the Log<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All Infinite Uploads entries are prefixed with&nbsp;<code>INFINITE_UPLOADS<\/code>, so you can filter the log for just our output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f wp-content\/debug.log | grep INFINITE_UPLOADS<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you don't have command-line access, open&nbsp;<code>wp-content\/debug.log<\/code>&nbsp;in your hosting file manager, or use a log viewer plugin that displays it inside wp-admin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"when-to-use-each-define\">When to Use Each Define<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Connection, sync, or billing\/usage problems<\/strong>&nbsp;&rarr;&nbsp;<code>INFINITE_UPLOADS_API_DEBUG<\/code><\/li>\n\n\n\n<li><strong>An API response looks wrong and you need the raw data<\/strong>&nbsp;&rarr; add&nbsp;<code>INFINITE_UPLOADS_API_DEBUG_ALL<\/code><\/li>\n\n\n\n<li><strong>The site is slow or hanging and a plugin may be over-using cloud storage<\/strong>&nbsp;&rarr;&nbsp;<code>INFINITE_UPLOADS_SW_DEBUG<\/code><\/li>\n\n\n\n<li><strong>You know which plugin, but need the exact code path<\/strong>&nbsp;&rarr; add&nbsp;<code>INFINITE_UPLOADS_SW_DEBUG_BACKTRACE<\/code><\/li>\n\n\n\n<li><strong>Investigating repeated lookups of the same file<\/strong>&nbsp;&rarr;&nbsp;<code>INFINITE_UPLOADS_SW_DEBUG_CACHE<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"best-practices\">Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable only the define you need for the problem in front of you. The API and stream wrapper logs answer different questions.<\/li>\n\n\n\n<li>These defines are safe to leave on briefly, but the stream wrapper options (especially with backtraces) add overhead to every request.&nbsp;<strong>Remove them once you've captured what you need.<\/strong><\/li>\n\n\n\n<li>Reproduce the issue once with logging on, then read the log, rather than leaving logging running indefinitely.<\/li>\n\n\n\n<li>When sending a log to our support team, the prefixes make it easy to copy just the relevant&nbsp;<code>INFINITE_UPLOADS<\/code>&nbsp;lines.<\/li>\n<\/ul>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Infinite Uploads includes several optional debug defines that write detailed diagnostic logs about what the plugin is doing behind the scenes. They&#8217;re meant for troubleshooting a specific problem, such as a failing connection, a slow sync, or another plugin making excessive cloud storage requests, and answering our support team&#8217;s questions with real data instead of [&hellip;]<\/p>\n","protected":false},"author":3787,"featured_media":11753,"template":"","meta":{"_acf_changed":false,"wds_primary_doc_category":0,"wds_primary_doc_tag":0,"footnotes":""},"doc_category":[147,164],"doc_tag":[],"class_list":["post-11749","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-developers","doc_category-troubleshooting"],"acf":[],"year_month":"2026-07","word_count":1019,"total_views":"76","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Blake Whittle","author_nicename":"blakew","author_url":"https:\/\/infiniteuploads.com\/blog\/author\/blakew\/"},"doc_category_info":[{"term_name":"Developers","term_url":"https:\/\/infiniteuploads.com\/docs-category\/developers\/"},{"term_name":"Troubleshooting","term_url":"https:\/\/infiniteuploads.com\/docs-category\/troubleshooting\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs\/11749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/users\/3787"}],"version-history":[{"count":3,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs\/11749\/revisions"}],"predecessor-version":[{"id":11752,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs\/11749\/revisions\/11752"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/media\/11753"}],"wp:attachment":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/media?parent=11749"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/doc_category?post=11749"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/doc_tag?post=11749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}