Title: JS Error Logger
Author: JFG Media
Published: <strong>Novembre 24, 2024</strong>
Last modified: Desembre 11, 2025

---

Search plugins

![](https://ps.w.org/js-error-logger/assets/icon-256x256.jpg?rev=3195786)

# JS Error Logger

 By [JFG Media](https://profiles.wordpress.org/jfgmedia/)

[Download](https://downloads.wordpress.org/plugin/js-error-logger.1.3.1.zip)

[Live Preview](https://bal.wordpress.org/plugins/js-error-logger/?preview=1)

 * [Details](https://bal.wordpress.org/plugins/js-error-logger/#description)
 * [Reviews](https://bal.wordpress.org/plugins/js-error-logger/#reviews)
 *  [Installation](https://bal.wordpress.org/plugins/js-error-logger/#installation)
 * [Development](https://bal.wordpress.org/plugins/js-error-logger/#developers)

 [Support](https://wordpress.org/support/plugin/js-error-logger/)

## Description

The plugin catches most JS errors, logs them, and displays them in a dashboard widget.

Here are some of its features:

 *  Except for the plugin settings, there is no database storage involved. Log is
   written in a “.log” file.
 *  Display latest JS errors in a dashboard widget.
 *  Refresh errors from the dashboard widget.
 *  See the full error log on a separate page.
 *  Ignore errors if the user agent contains a specific string.
 *  Ignore errors if the error contains a specific string.
 *  Ignore errors if the script url contains a specific string.
 *  See which page and which script triggered the errors.
 *  Choose the maximum amount of errors to log per page load.
 *  Exclude logging errors from specific post types.
 *  Choose how ajax calls are made.

#### Developer hooks and filters

The plugin cleans the log every 24 hours, to only keep the last 100 entries.
 You
may use the “jserrlog_max_log_entries” WP filter to enable more or less entries,
by returning an integer: `add_filter('jserrlog_max_log_entries',function(){return
200;})`

Alter error data:
 You may use the “jserrlog_pre_insert_error” WP filter to modify
the error data before it’s inserted into the log file: `add_filter('jserrlog_pre_insert_error',
function($error_data){return $error_data;})`

Trigger integrations:
 You may use the “jserrlog_after_log” WP hook to trigger an
action (Slack notification, etc.) after an error was logged: `add_action('jserrlog_after_log',
function($error_data){//do something})`

Backup old errors:
 You may use the “jserrlog_before_log_maintenance” WP hook to
trigger an action (archive errors, etc.) before old errors are deleted: `add_action('
jserrlog_before_log_maintenance',function($errors){//do something})`

#### Multisite

The plugin works with multisite. There’s one error log per site.

## Screenshots

 * [[
 * The JS Error Logger dashboard widget
 * [[
 * The full error log from within the plugin settings
 * [[
 * Some of the settings

## Installation

 1. Visit the Plugins page within your dashboard and select “Add New”
 2. Search for “JS Error Logger”
 3. Click “Install”

## Reviews

![](https://secure.gravatar.com/avatar/69addaf65ff1c36d4d2a440adc243f2622f1fc803e077b633db1332967cc2e97?
s=60&d=retro&r=g)

### 󠀁[Godsent](https://wordpress.org/support/topic/godsent-4/)󠁿

 [steaklassie](https://profiles.wordpress.org/steaklassie/) Gener 14, 2025 1 reply

My users are having an annoying issue on the frontend of my website that I cannot
reproduce. It’s causing chaos, this plugin seems to be exactly what I need to get
to the bottom of this!

 [ Read all 1 review ](https://wordpress.org/support/plugin/js-error-logger/reviews/)

## Contributors & Developers

“JS Error Logger” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ JFG Media ](https://profiles.wordpress.org/jfgmedia/)

“JS Error Logger” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/js-error-logger/contributors)
for their contributions.

[Translate “JS Error Logger” into your language.](https://translate.wordpress.org/projects/wp-plugins/js-error-logger)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/js-error-logger/), 
check out the [SVN repository](https://plugins.svn.wordpress.org/js-error-logger/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/js-error-logger/)
by [RSS](https://plugins.trac.wordpress.org/log/js-error-logger/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.3.1

 * Tested up to WordPress 6.9
 * Renamed some template variables to ensure they can’t be mistaken for global variables
 * Changed some native PHP functions such as mk_dir, rm_dir, fopen, etc… to use 
   WP_Filesystem

#### 1.3

 * Dropped support for PHP<7.4
 * Added links to our other plugins in the settings area
 * Addition of an admin notice
 * Addition of 2 developer hooks and 1 filter

#### 1.2

 * Accessibility improvements
 * Fix: Make sure the mu-plugin is also deleted when deactivating the plugin, and
   not just when uninstalling it
 * Added 3 more settings to the UI that were previously only accessible through 
   WP filters

#### 1.1.11

 * Fix: Properly dequeue the early loaded script in the front-end, if js error logging
   is not enabled

#### 1.1.10

 * Security hardening
 * Documentation of variables for the translators
 * Minor Fix: Ensure the mu-plugins directory is writable before creating the early
   loader, to avoid PHP warnings

#### 1.1.9

 * Fix: Properly dequeue the early loaded script in admin, if back end logging is
   not enabled

#### 1.1.7

 * Improvement: better update mechanism to make sure the mu-plugin also gets updated

#### 1.1.6

 * New: it is now possible to also log back end js errors

#### 1.1.5

 * Fix: An HTML attribute was escaped with wp_kses instead of esc_attr, which could
   lead to some display issues if double quotes were in the attribute text

#### 1.1.4

 * Fix: When the dashboard widget was initially empty, then refreshed, and an error
   was there, the “View” button was not clickable

#### 1.1.3

 * Fix: A change in the ID of the dashboard widget was preventing the “Refresh log”
   button from working properly

#### 1.1.2

 * Fix: Removed the “string” return type on rewrite_script_src to prevent potential
   issues

#### 1.1.1

 * Fix: issue with special character encoding
 * Fix: Missing trailing slash during the creation of the “js-error-logger-log” 
   directory
 * Improvement: Plugin should detect the most popular caching plugins, and remind
   users to clear their cache after changing some settings

#### 1.0

 * Initial Release

## Meta

 *  Version **1.3.1**
 *  Last updated **4 mesos ago**
 *  Active installations **10+**
 *  WordPress version ** 5.0 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 7.4 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/js-error-logger/) i [French (France)](https://fr.wordpress.org/plugins/js-error-logger/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/js-error-logger)
 * Tags
 * [dashboard widget](https://bal.wordpress.org/plugins/tags/dashboard-widget/)[debug](https://bal.wordpress.org/plugins/tags/debug/)
   [error reporting](https://bal.wordpress.org/plugins/tags/error-reporting/)[javascript](https://bal.wordpress.org/plugins/tags/javascript/)
   [JS](https://bal.wordpress.org/plugins/tags/js/)
 *  [Advanced View](https://bal.wordpress.org/plugins/js-error-logger/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/js-error-logger/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/js-error-logger/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/js-error-logger/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/js-error-logger/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/js-error-logger/reviews/?filter=1)

[Add my review](https://wordpress.org/support/plugin/js-error-logger/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/js-error-logger/reviews/)

## Contributors

 *   [ JFG Media ](https://profiles.wordpress.org/jfgmedia/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/js-error-logger/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://paypal.me/jfgui)