<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>debug - Matteo Cisilino</title>
	<atom:link href="https://www.cisilino.com/en/tag/debug/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cisilino.com/en/</link>
	<description>Guide su WordPress, server e sicurezza</description>
	<lastBuildDate>Fri, 30 Oct 2026 16:06:37 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>Debug log: PHP errors in their own file</title>
		<link>https://www.cisilino.com/en/2026/10/30/debug-log-php-errors-their-own-file/</link>
					<comments>https://www.cisilino.com/en/2026/10/30/debug-log-php-errors-their-own-file/#respond</comments>
		
		<dc:creator><![CDATA[matteocisilino]]></dc:creator>
		<pubDate>Fri, 30 Oct 2026 16:05:59 +0000</pubDate>
				<category><![CDATA[CSDN manual]]></category>
		<category><![CDATA[Cisilino Site Defense Network]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[PHP errors]]></category>
		<guid isPermaLink="false">https://www.cisilino.com/?p=1056</guid>

					<description><![CDATA[<p>How to turn on the Debug log tab of the plugin CSDN since version 1.0.15: duration, file size, rotation, downloads and limits.</p>
<p>The post <a href="https://www.cisilino.com/en/2026/10/30/debug-log-php-errors-their-own-file/">Debug log: PHP errors in their own file</a> first appeared on <a href="https://www.cisilino.com/en/">Matteo Cisilino</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The WordPress debug log is a new feature in the CSDN plugin since version 1.0.15. It logs the site&#8217;s PHP errors into its own file, without touching <code>wp-config.php</code>. You switch it on from the backend, and it switches itself off.</p>
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" src="https://www.cisilino.com/wp-content/uploads/2026/10/manuale-csdn-log-di-debug.webp" alt="Diagram of WordPress with the WordPress debug log tab of the plugin CSDN highlighted" width="1200" height="630"/></figure>
<h2>Where it is</h2>
<p>Go to Settings &gt; Cisilino Site Defense Network (point 1 in the image) and open the <strong>Debug log</strong> tab (point 2). There are three sections:</p>
<ul>
<li>point 3: “Site debug log”, with status and activation.</li>
<li>point 4: “Collected files”.</li>
<li>point 5: “Latest entries”.</li>
</ul>
<h2>What the WordPress debug log is for</h2>
<p>It comes in useful when the site shows a blank page or a critical error, when something breaks after an update, or when your hosting won&#8217;t let you edit <code>wp-config.php</code> or read the logs. The <code>WP_DEBUG</code> and <code>WP_DEBUG_LOG</code> constants are defined before the plugins load, so a plugin can&#8217;t turn them on. This log instead uses a PHP error handler hooked onto the plugin&#8217;s own loading.</p>
<p>This log adds to things, it doesn&#8217;t replace anything. Errors keep arriving wherever they arrived before, meaning <code>debug.log</code> and the server log. It sends nothing to the panel.</p>
<h2>How to use it</h2>
<ol>
<li>Open the <strong>Debug log</strong> tab.</li>
<li>Choose <strong>Stay on for</strong>: <strong>1 hour</strong>, <strong>24 hours</strong> (default) or <strong>7 days</strong>.</li>
<li>Choose <strong>Maximum size per file</strong>.</li>
<li>Press <strong>Turn on the debug log</strong>. You&#8217;ll read “Debug log turned on. It switches itself off when the chosen time runs out; the files stay.”.</li>
<li>Reproduce the problem on the site.</li>
<li>Go back to the tab. Read “Latest entries”, or download the file from the “Collected files” section.</li>
<li>When you&#8217;re done, press <strong>Turn off the debug log</strong>, or wait for it to expire. You&#8217;ll see “Debug log turned off. The files collected are still here below.”.</li>
</ol>
<p>The “Status:” line tells you whether the log is “on, switches off on dd/mm/yyyy hh:mm”, “off (expired on …)” or “off”. While the log is on you can change the size with <strong>Save size</strong>.</p>
<h3>Collected files</h3>
<p>The table lists name, size, and the <strong>Download</strong> and <strong>Delete</strong> buttons. Below you&#8217;ll find <strong>Delete all files</strong>. Before deleting, the plugin asks for confirmation: “Delete this file? This cannot be undone.”. For <strong>Delete all files</strong> the text is “Delete all debug log files? This cannot be undone.”. If there&#8217;s nothing you&#8217;ll read “No files: the log has never been switched on, or it hasn&#8217;t logged anything yet.”.</p>
<h3>Latest entries</h3>
<p>The box shows the 200 most recent entries, newest first. The <strong>All levels</strong> menu lets you filter by Fatal error, Parse error, Recoverable error, Warning, Notice or Deprecated. Then press <strong>Filter</strong>. For anything else, download the files. If the filter finds nothing, you&#8217;ll read “No entries match this filter.”.</p>
<p>An entry has this shape:</p>
<p><code>[2026-10-29 10:15:03 UTC] Warning: message in /path/file.php:12 | GET /page</code></p>
<ul>
<li>The time is in UTC, different from the site time shown in the <a href="https://www.cisilino.com/en/?p=984">Activity log</a>.</li>
<li>After the vertical bar you&#8217;ll find the method and path of the request, without the query string. From the command line or cron you&#8217;ll see “cli/cron”.</li>
<li>A multi-line message, such as a stack trace, stays a single entry, with the following lines indented.</li>
<li>The lines “Info: debug log enabled (user N)” and “Info: debug log disabled (user N)” carry no level: a filter hides them.</li>
</ul>
<h2>Default values and limits</h2>
<ul>
<li>Duration of the WordPress debug log: 1 hour, 24 hours or 7 days. Any other value becomes 24 hours.</li>
<li>Size per file: 1, 5, 10, 25 or 50 MB. The default is 5 MB. The chosen size is saved when you press <strong>Turn on the debug log</strong> or <strong>Save size</strong>. Watch out: <strong>Turn off the debug log</strong> resets the size to 5 MB, because that form doesn&#8217;t include the size menu.</li>
<li>Overall cap: 200 MB, adding up the <code>.log</code> and <code>.zip</code> files together.</li>
<li>Every message is truncated to 4000 characters.</li>
<li>It only logs PHP errors: not slow queries, JavaScript errors or HTTP requests.</li>
</ul>
<h2>Examples</h2>
<ul>
<li>A critical error after a plugin update: turn it on for 1 hour, reload the page, filter “Fatal error”. The entry shows the file and line, for example <code>/…/plugins/xyz/file.php:210 | GET /shop/</code>.</li>
<li>Occasional warnings: 24 hours, filter on Warning or Deprecated. If the file has been rotated, download the zip.</li>
<li>A slow site with no clear cause: 7 days with 25 MB files, then look for Notice and Warning entries that keep repeating.</li>
</ul>
<p>Keep it on for only as long as you need: often 1 hour is enough.</p>
<p><strong>Warning:</strong> the debug log files contain server paths and fragments of data. Don&#8217;t share them publicly. They stay on disk even after switching off and after uninstalling the plugin, which deletes the options but not the files. Delete them yourself when you&#8217;re finished. The overall cap is 200 MB.</p>
<p><strong>Warning:</strong> on an nginx server, turning it on can be refused until the server blocks the <code>csdn-debug-*</code> folder. The message is “Debug log not turned on: the files in its folder appear reachable from the internet (probably a server with no .htaccess support, such as nginx). The logs can contain paths and data: block access to the csdn-debug-* folder in the server configuration and try again.”. If you don&#8217;t manage the server yourself, ask whoever does.</p>
<p><strong>Warning:</strong> the log doesn&#8217;t see errors suppressed with <code>@</code>, nor ones generated before the plugin loads. For example, it doesn&#8217;t see errors from <code>wp-config.php</code>. The plugin&#8217;s WordPress debug log doesn&#8217;t replace the server&#8217;s own logs.</p>
<h2>What happens behind the scenes</h2>
<p>The WordPress debug log saves its files in a folder named <code>wp-content/uploads/csdn-debug-</code> followed by 16 random characters. Inside are an <code>index.php</code>, a <code>.htaccess</code> denying access, and the file in use, <code>csdn-debug.log</code>. On activation the plugin writes a test file and tries to read it over HTTP. If it responds, the plugin refuses to turn the log on.</p>
<p>When the file in use exceeds the chosen size, it is closed, compressed into a <code>.zip</code>, and a new one starts. No entry is lost. The original <code>.log</code> is only deleted once the zip has been verified. If the compression fails, the <code>.log</code> stays. “Latest entries” only reads from the file in use, so after a rotation the older entries sit inside the zip files.</p>
<p>Before rotating, the plugin checks the 200 MB cap. If it&#8217;s reached, the log stops so nothing gets overwritten. The yellow notice reads: “The log has stopped because the files reached the space cap (200 MB): to avoid overwriting data, it stops writing. Download or delete the files, then turn it back on.”. To start again, delete the files and turn the log back on.</p>
<p>On expiry the log switches itself off, but the files stay. The plugin never truncates or deletes them: only you do that, with <strong>Delete</strong> or <strong>Delete all files</strong>. For fatal errors, the entry is written at the end of the request.</p>
<h2>If the WordPress debug log doesn&#8217;t work</h2>
<ul>
<li>“Debug log not turned on: the uploads folder is not writable.”: check the permissions on the <code>wp-content/uploads</code> folder.</li>
<li>The log doesn&#8217;t write: if writing fails, the plugin reports it with an entry “Site debug log: …” in the “Last attempts” of the <a href="https://www.cisilino.com/en/?p=984">Activity log</a> tab.</li>
<li>The log has stopped for the cap: download what you need, delete the files, and turn it back on.</li>
</ul>
<p>The <a href="https://www.cisilino.com/en/?p=972">general guide to the manual</a> explains where this tab fits in. To understand the WordPress constants better, look at the <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/" target="_blank" rel="noopener">official WordPress debugging guide</a>: it explains <code>WP_DEBUG</code> and <code>WP_DEBUG_LOG</code>, which this plugin cannot replace.</p>
<p>Previous chapter: <a href="https://www.cisilino.com/en/?p=984">Activity log</a>. Next chapter: <a href="https://www.cisilino.com/en/?p=986">Troubleshooting and frequently asked questions</a>.</p><p>The post <a href="https://www.cisilino.com/en/2026/10/30/debug-log-php-errors-their-own-file/">Debug log: PHP errors in their own file</a> first appeared on <a href="https://www.cisilino.com/en/">Matteo Cisilino</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.cisilino.com/en/2026/10/30/debug-log-php-errors-their-own-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
