View Debug Log

View Debug Log

A lightweight developer tool for real-time WordPress debug monitoring

Plugin URL: GitHub Repository


Key Features

  1. Real-Time Debug Log Viewer
    • Displays WP_DEBUG_LOG output directly in WordPress admin
    • No need to manually access wp-content/debug.log via FTP/SFTP
  2. Privacy & Security
    • Access restricted to users with manage_options capability (Admins only)
    • No database writes – reads log file directly
  3. Troubleshooting Tools
    • File size monitoring
    • Quick log clearing functionality
    • Line number reference for errors
  4. Lightweight Implementation
    • Single admin page (~50KB memory usage)
    • No external dependencies

Technical Implementation

Admin Interface:

  • Adds “Debug Log” submenu under Tools/Dashboard
  • Uses WordPress core filesystem API for secure file access

Compatibility:

  • Works with default WP_DEBUG_LOG configuration
  • Tested with PHP 7.4+ and WordPress 5.6+

Ideal Use Cases

  1. Development Environments
    • Rapid debugging during plugin/theme development
  2. Staging Sites
    • Monitor errors before pushing to production
  3. Troubleshooting
    • Diagnose white screens or unexpected behavior
  4. Maintenance
    • Regular error log reviews

Limitations

⚠️ Not for Production:

  • Debug logs should never be publicly accessible on live sites

⚠️ Large Files:

  • May struggle with log files >10MB (no pagination)

⚠️ No Filtering:

  • Basic view-only interface without search/filter capabilities

Installation

  1. Download ZIP from GitHub
  2. Upload to /wp-content/plugins/
  3. Activate in WordPress admin

Configuration:

Requires WP_DEBUG_LOG enabled in wp-config.php:

define( 'WP_DEBUG', true );
if (WP_DEBUG) {
    define( 'WP_DEBUG_LOG', false );
    define( 'WP_DEBUG_DISPLAY', false );
    # One level up from WordPress installtion
    $path = realpath($_SERVER["DOCUMENT_ROOT"] . '/..') . '/debug.log';
    @ini_set('log_errors', 'On');
    error_reporting(0);
    @ini_set('display_errors', 0);
}
Scroll to Top