Error Log Module — User Guide
Table of Contents
The Error Log Viewer is the primary module of the Advanced Analytics plugin. It reads your PHP error log file in reverse order (newest entries first), parses each entry, and displays them in a searchable, filterable table directly inside your WordPress admin area.
You need the Administrator role (the
manage_options capability) to access the Error Log Viewer. Other user roles will not see the menu item unless the “Restrict plugin to admins only” setting is disabled.Prerequisites
For the Error Log Viewer to function, the following conditions must be met on your server:
Required PHP / WordPress Configuration
| Requirement | Description |
|---|---|
| WP_DEBUG | Must be set to true in wp-config.php (unless “Keep reading error log” setting is enabled). |
| WP_DEBUG_LOG | Must be set to true in wp-config.php (unless “Keep reading error log” setting is enabled). |
| PHP log_errors | Must be enabled in your php.ini configuration. |
| error_log path | A valid, absolute path must be configured for the PHP error_log directive. Relative paths are not supported. |
| File permissions | The error log file must be both readable and writable by the web server process. |
You can enable debuging from plugins settings, just make sure that both “WP Debug Enable” and “WP Debug Log Enabled” are checked. Plugin will try to populate the wp-config.php with these settings (if it can). Otherwise you have to enable it yourself.
wp-config.php file (before the line that says “That’s all, stop editing!”):define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );'WP_DEBUG_LOG' is set to something different than ‘debug.log’ or true. Set it to something like define( 'WP_DEBUG_LOG', '/var/www/htmlwp-content/debug_0928340923840982390.log' );, otherwise you may expose your logs to the public.Accessing the Error Log Viewer
Once the plugin is installed and activated:
- In the WordPress admin sidebar, click “0 Day” (the top-level menu).
- Click “Error Log viewer” from the submenu.
The viewer will automatically detect and read your PHP error log file. If any prerequisites are missing, you will see an informational message explaining what needs to be configured.
The Log Table
The main screen displays error log entries in a WordPress list table, sorted with the most recent entries at the top.
Columns
| Column | Description |
|---|---|
| Time | Shows a relative timestamp (e.g., “3 minutes ago”) along with the full formatted date. The timezone is indicated in the column header. |
| Severity | A colour-coded badge indicating the error severity level (e.g., Error, Warning, Notice, Fatal). See Severity Levels for the full list. |
| Message | The error message text. Includes clipboard and share icons. If the error has a stack trace, click “Show details” to expand it. |
| Source | Identifies the origin of the error — a plugin name, theme name, “WP Core”, or “WP Admin Core”. Includes a link to view the source file. |
Stack Traces
When an error includes a stack trace, the Message column shows a “Show details” toggle. Clicking it reveals the full call stack with:
- Frame number and function/method name
- Source file path with line number
- Clickable links to view the source file at the error line
Severity Levels
The Error Log Viewer recognizes and color-codes the following severity types:
| Severity | Default Colour | Description |
|---|---|---|
| Fatal | #f09595 | Critical errors that halt execution (e.g., calling undefined functions, out-of-memory). |
| Error | #ffb3b3 | Runtime errors that do not stop execution but indicate problems. |
| Parse | #e3bb8d | Syntax errors detected during parsing. |
| Warning | #ffff00 | Non-fatal issues that may indicate problematic code. |
| Notice | #feeb8e | Minor issues such as undefined variables or deprecated usage. |
| Deprecated | #c4b576 | Usage of functions or features scheduled for removal in future PHP or WordPress versions. |
| User | #85b395 | User-generated errors triggered via trigger_error(). |
| Info | #aeaeec | Informational messages. |
| Success | #00ff00 | Success status indicators. |
| Request | #759b71 | HTTP request-related log entries. |
| REST No Route | #759b71 | REST API requests to non-existent routes. |
| REST Forbidden | #759b71 | REST API requests denied due to permissions. |
| Not Set | #7a6f72 | Log entries where the severity could not be determined. |
Severity Filtering
You can control which severity types are visible in the log table. This is useful for focusing on specific error types.
Toggle Individual Severities
- Above the log table, locate the row of severity checkboxes with coloured labels.
- Uncheck a severity to hide all entries of that type.
- Check a severity to show entries of that type again.
- The page reloads automatically after each toggle.
Show Only One Severity
- Use the single severity dropdown above the table.
- Select the severity type you want to view exclusively.
- To reset and show all severities again, select the reset option from the dropdown.
Searching the Log
Use the search box in the top-right corner of the log table to search through error messages.
- The search queries both the error message text and stack trace content.
- Type your search term and press Enter or click Search.
- The search is case-insensitive and matches partial text.
- To clear the search, empty the box and press Enter.
Filtering by Plugin
You can filter the log to show only errors originating from a specific plugin:
- Locate the plugin filter dropdown above the log table.
- Select the plugin name from the list (populated from all installed plugins).
- Click Filter to apply.
- Select “All plugins” to remove the filter.
Source Code Viewer
The Error Log Viewer lets you inspect the source code at the exact line where an error occurred, without leaving the admin area.
- In the Source column or within a stack trace, click the file link (e.g., “View source”).
- A modal window (ThickBox) opens showing the PHP source file with syntax highlighting.
- The error line is highlighted and the view automatically scrolls to it.
- Close the modal to return to the log table.
If given error has stack trace info (you will see “Show Details” button), when viewing details, you can click on every path line and that will open the source viewer – the error line is highlighted and the view automatically scrolls to it.
wp-config.php) are blocked from viewing by default when the “Protect config source files” setting is enabled. This prevents accidental exposure of sensitive credentials.Copy & Share
Each error entry provides quick actions for sharing error details:
Copy to Clipboard
Click the clipboard icon next to any error message to copy the full error text (including stack trace if present) to your clipboard. A tooltip confirms the copy was successful.
Share
Click the share icon to use your browser’s native Web Share API (available on supported browsers and mobile devices). This allows you to share the error details via email, messaging apps, or other sharing targets on your device.
Truncating the Log
Over time, the error log file can grow large. The plugin provides two truncation options:
Truncate (Clear All)
Completely empties the error log file. All entries are permanently removed.
- Click the “Truncate log” button above the log table.
- Confirm the action in the dialog.
- The log file is emptied and the page reloads.
Truncate & Keep Last Records
Clears the log but preserves the most recent entries. The number of entries to keep is configurable in the plugin settings (default: 10).
- Click the “Truncate (keep last records)” button above the log table.
- Confirm the action in the dialog.
- The log is truncated, keeping only the last N entries.
Downloading the Log
You can download the complete error log file to your computer:
- Click the “Download” button above the log table.
- The file downloads with the original filename.
The download uses HTTP streaming with 8 MB chunks for efficient transfer of large files. It also supports resumable downloads (HTTP Range requests).
CSV Export
Export the currently filtered log entries to a CSV file for analysis in spreadsheet applications.
- Apply any desired filters or search criteria (the export respects your current filter context).
- Click the “CSV Export” button above the log table (only visible when entries are present).
- A progress bar appears during the export. You can click Cancel if needed.
- The CSV file downloads automatically once complete.
Exported Fields
| Field | Description |
|---|---|
| Timestamp | The date and time of the error. |
| Severity | The error severity level. |
| Message | The error message text. |
| Stack Trace | JSON-encoded stack trace data (if present). |
| Plugin | The identified source plugin or theme. |
Automatic Log Truncation
You can schedule automatic log truncation to prevent the error log from growing indefinitely.
- Navigate to 0 Day → Settings.
- Find the “Auto clear log” option.
- Select a schedule: Hourly, Twice Daily, Daily, or Weekly.
- Click Save Changes.
When the scheduled event runs, the log is truncated while keeping the last N records (as configured by the “Records to keep on truncation” setting).
To disable automatic truncation, set the schedule back to “Disabled”.
Admin Bar Notifications
The plugin adds a live notification node to the WordPress admin bar that shows the most recent error from your log.
- The notification appears in the admin bar on every admin page.
- It displays the latest error message with severity styling.
- Click the notification to navigate directly to the Error Log Viewer page.
- The notification updates via a REST API call each time a page loads.
This feature can be disabled in the plugin settings by turning off “Live notifications in admin bar”.
Browser Push Notifications
The plugin can send browser push notifications when new errors are detected, even when you are on a different admin page.
- When you first visit a plugin page, your browser may ask for notification permission — click Allow.
- The plugin polls for new errors at a configurable interval (default: every 10 seconds, minimum: 5 seconds).
- When a new error is detected, a browser notification appears with the severity level and error message.
- Click the notification to jump directly to the Error Log Viewer page.
- Notifications auto-dismiss after 5 seconds.
Configuring Browser Notifications
Navigate to 0 Day → Settings to adjust:
| Setting | Description |
|---|---|
| Polling interval | How often (in seconds) the plugin checks for new errors. Default: 10, minimum: 5. |
| Disable notifications | Turn off browser push notifications entirely. |
Raw Log View
Below the parsed log table, the Error Log Viewer displays the raw log file content in a scrollable text block (dark background, white text, maximum height of 400 pixels).
- This shows the unprocessed log content exactly as it appears in the file.
- Auto-copy: Selecting any text in the raw log view automatically copies it to your clipboard. A tooltip confirms the copy.
Screen Options
Click Screen Options (top-right of the page, just below the admin bar) to customize the display:
Number of errors to read
Controls how many error entries are displayed per page. Enter a number and click Apply. Default is 100 records. This setting is stored per user account.
Column Visibility
Check or uncheck columns to show or hide them. Settings persist across sessions.
Settings
The plugin settings page provides the following options relevant to the Error Log Viewer:
Error Log Options
| Setting | Default | Description |
|---|---|---|
| Keep reading error log | Off | When enabled, reads the error log even if WP_DEBUG and WP_DEBUG_LOG are not set to true. Useful for production sites that have PHP error logging configured at the server level. |
| Records to keep on truncation | 10 | The number of most recent entries to preserve when using “Truncate (keep last records)”. |
| Auto clear log | Disabled | Schedule automatic log truncation. Options: Disabled, Hourly, Twice Daily, Daily, Weekly. |
| Protect config source files | On | Prevents viewing configuration and settings files (e.g., wp-config.php) through the source code viewer. |
Notification Options
| Setting | Default | Description |
|---|---|---|
| Live notifications in admin bar | On | Show the latest error in the WordPress admin bar on every admin page. |
| Browser notification polling interval | 10 seconds | How often (in seconds) the plugin checks for new errors for browser push notifications. Minimum: 5 seconds. |
| Disable browser notifications | Off | Turn off browser push notifications entirely. |
General Options
| Setting | Default | Description |
|---|---|---|
| Restrict plugin to admins only | On | When enabled, only users with the manage_options capability can see the plugin menu. When disabled, all users with the read capability can access it. |
| Enable plugin debug | Off | Enables additional debug features within the plugin itself. |
Severity Customization
Each severity type can be individually configured with:
- Custom color — Change the badge color for any severity level.
- Visibility — Show or hide individual severity types from the log display.
Dark Skin
The entire plugin supports a dark skin mode. When activated, all severity badges and UI elements adapt to a dark color scheme.
The dark skin preference is stored in your browser’s local storage and persists across page loads.
Security Notice
If your error log file uses the default WordPress location and name (
wp-content/debug.log), the plugin displays a security warning. This is because debug.log is a well-known path that attackers may attempt to access. You should configure a custom log file path outside the web root, custom file name, or add access restrictions to protect it (from the server confugration).To change the log file location, update your php.ini or wp-config.php:
// Option 1: Set a custom path in wp-config.php
define( 'WP_DEBUG_LOG', '/path/outside/webroot/php-errors.log' );
// Option 2: Set in php.ini
// error_log = /path/outside/webroot/php-errors.logTroubleshooting
“WP_DEBUG is disabled”
The plugin requires WP_DEBUG to be set to true in wp-config.php. Add define( 'WP_DEBUG', true ); to your configuration file. Alternatively, enable the “Keep reading error log” setting to bypass this requirement.
“WP_DEBUG_LOG is disabled”
WordPress is not configured to write errors to a log file. Add define( 'WP_DEBUG_LOG', true ); to wp-config.php. Alternatively, enable the “Keep reading error log” setting.
“PHP log_errors is disabled”
Error logging is disabled at the PHP level. Contact your hosting provider or update your php.ini to set log_errors = On.
“No error_log path configured”
PHP does not have an error_log path set. Configure the error_log directive in php.ini or set WP_DEBUG_LOG to a specific file path in wp-config.php.
“Error log uses a relative path”
The error_log path in your PHP configuration is relative. The plugin requires an absolute path. Update the error_log directive in php.ini to use a full absolute path (e.g., /var/log/php-errors.log).
“Error log file does not exist”
The configured log file has not been created yet. This usually means no PHP errors have been logged. Ensure your PHP configuration is correct and that the directory is writable. You can trigger a test error to create the file.
“Error log file is not writable”
The web server process does not have write permission on the log file. Update the file permissions so the web server user can write to it (e.g., chmod 664 or ensure correct ownership).
“Error log file is not accessible”
The web server process cannot read the log file. Check file permissions and ownership. The file must be readable by the web server user.
The log viewer is empty but errors exist in the file
Possible causes:
- All severity types may be unchecked in the severity filter — re-enable the severity toggles.
- A search or plugin filter may be active — clear all filters.
- The log file format may not be recognized — the parser expects the standard PHP error log format (
[timestamp] Severity: message).
The page takes a long time to load
Large log files can slow down parsing. Try the following:
- Reduce the “Number of errors to read” in Screen Options.
- Truncate the log file to remove old entries.
- Set up automatic truncation to keep the log file manageable.
The reader has built-in safety limits: it stops after 25 seconds, 32 MB of memory usage, or 1,000 collected entries — whichever comes first.
Browser notifications are not working
Check the following:
- Your browser must support the Notification API.
- You must have granted notification permission when prompted (check your browser settings).
- The “Disable browser notifications” setting must be turned off.
- The page must be served over HTTPS (required by most browsers for notifications).
Error Messages Reference
| Message | Cause | Resolution |
|---|---|---|
| “WP_DEBUG is disabled” | WP_DEBUG constant is false |
Set WP_DEBUG to true or enable “Keep reading error log” |
| “WP_DEBUG_LOG is disabled” | WP_DEBUG_LOG is not set or false |
Set WP_DEBUG_LOG to true or enable “Keep reading error log” |
| “PHP log_errors disabled” | log_errors is off in php.ini |
Enable log_errors in PHP config |
| “No error_log path” | error_log not set in PHP config |
Configure error_log directive |
| “Error log uses relative path” | Relative path in error_log |
Use an absolute path |
| “Error log not exists” | File not found on disk | Verify path and trigger a test error |
| “Error log not writable” | Insufficient file permissions | Fix file ownership/permissions |
| “Error log not accessible” | Cannot read file | Fix file ownership/permissions |
See
Error Log for architectural details, class references, hooks, REST API endpoints, AJAX actions, and code examples for extending the Error Log Viewer programmatically.