{"id":413985,"date":"2024-11-24T08:00:00","date_gmt":"2024-11-24T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/js-error-logger\/"},"modified":"2025-06-19T23:14:00","modified_gmt":"2025-06-19T23:14:00","slug":"js-error-logger","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/js-error-logger\/","title":{"rendered":"JS Error Logger"},"content":{"rendered":"<p>The plugin catches most JS errors, logs them, and displays them in a dashboard widget.<\/p>\n<p>Here are some of its features:<\/p>\n<ul>\n<li>\nExcept for the plugin settings, there is no database storage involved. Log is written in a \u201c.log\u201d file.\n<\/li>\n<li>\nDisplay latest JS errors in a dashboard widget.\n<\/li>\n<li>\nRefresh errors from the dashboard widget.\n<\/li>\n<li>\nSee the full error log on a separate page.\n<\/li>\n<li>\nIgnore errors if the user agent contains a specific string.\n<\/li>\n<li>\nIgnore errors if the error contains a specific string.\n<\/li>\n<li>\nIgnore errors if the script url contains a specific string.\n<\/li>\n<li>\nSee which page and which script triggered the errors.\n<\/li>\n<li>\nChoose the maximum amount of errors to log per page load.\n<\/li>\n<li>\nExclude logging errors from specific post types.\n<\/li>\n<li>\nChoose how ajax calls are made.\n<\/li>\n<\/ul>\n<h4>Developer hooks and filters<\/h4>\n<p>The plugin cleans the log every 24 hours, to only keep the last 100 entries.<br \/>\nYou may use the \u201cjserrlog_max_log_entries\u201d WP filter to enable more or less entries, by returning an integer: <code>add_filter('jserrlog_max_log_entries',function(){return 200;})<\/code><\/p>\n<p>Alter error data:<br \/>\nYou may use the \u201cjserrlog_pre_insert_error\u201d WP filter to modify the error data before it\u2019s inserted into the log file: <code>add_filter('jserrlog_pre_insert_error',function($error_data){return $error_data;})<\/code><\/p>\n<p>Trigger integrations:<br \/>\nYou may use the \u201cjserrlog_after_log\u201d WP hook to trigger an action (Slack notification, etc.) after an error was logged: <code>add_action('jserrlog_after_log',function($error_data){\/\/do something})<\/code><\/p>\n<p>Backup old errors:<br \/>\nYou may use the \u201cjserrlog_before_log_maintenance\u201d WP hook to trigger an action (archive errors, etc.) before old errors are deleted: <code>add_action('jserrlog_before_log_maintenance',function($errors){\/\/do something})<\/code><\/p>\n<h4>Multisite<\/h4>\n<p>The plugin works with multisite. There\u2019s one error log per site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Logs front-end javascript errors, and displays them in a dashboard widget<\/p>\n","protected":false},"author":65,"featured_media":413986,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"JS Error Logger - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Logs front-end javascript errors, and displays them in a dashboard widget"},"footnotes":""},"categories":[1],"tags":[2795,7,16764,826,1298],"class_list":["post-413985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-dashboard-widget","tag-debug","tag-error-reporting","tag-javascript","tag-js"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/413985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=413985"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/413985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/413986"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=413985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=413985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=413985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}