Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Remove PHP Error LogsNew to Visual Studio Code? Get it now.
Remove PHP Error Logs

Remove PHP Error Logs

Serhat Aksakal

|
1 install
| (0) | Free
Remove all error_log() function calls from PHP files in your workspace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Remove PHP Error Logs

A VS Code extension that removes all error_log() function calls from PHP files in your workspace.

Features

  • Fast Performance: Optimized line-by-line processing prevents hanging on large files
  • File Size Protection: Automatically skips files larger than 5MB to prevent performance issues
  • Cancellable Operations: Users can cancel long-running operations
  • Smart Detection: Removes various forms of error_log calls (single-line, multi-line, inline)
  • Progress Tracking: Real-time progress with file count and current file name
  • Safety First: Asks for confirmation before making changes
  • Vendor Exclusion: Automatically excludes vendor directories
  • Clean Output: Removes excessive blank lines left after deletion
  • Error Handling: Continues processing other files if one file fails

Usage

  1. Open a workspace containing PHP files
  2. Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  3. Run command: PHP: Remove PHP Error Logs
  4. Confirm the action when prompted
  5. The extension will scan all PHP files and remove error_log calls

You can also right-click on a folder in the Explorer and select "Remove PHP Error Logs" from the context menu.

What it removes

The extension removes various forms of error_log calls:

// Simple error_log
error_log('Debug message');

// Error_log with multiple parameters
error_log('Error occurred', 3, '/var/log/myapp.log');

// Multi-line error_log
error_log(
    'Complex message: ' .
    $variable .
    ' at line ' . __LINE__
);

// Inline error_log (as part of other statements)
$result = doSomething() or error_log('Failed');

Safety

  • The extension will ask for confirmation before making changes
  • It excludes vendor directories by default
  • Shows a summary of changes made

Requirements

  • VS Code 1.103.0 or higher
  • A workspace with PHP files

Known Issues

None currently reported. Please report issues on the GitHub repository.

Release Notes

1.0.0

Initial release of Remove PHP Error Logs extension.

  • Smart detection of various error_log call patterns
  • Progress tracking with user feedback
  • Safety confirmation before making changes
  • Automatic exclusion of vendor directories
  • Clean output with blank line removal

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft