Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

JSNLog

Security covered Drupal 9–11
View on drupal.org

Overview

This module implements the JSNLog library. And stores JavaScript messages in watchdog.

Installation

  • Prefered option: composer require drupal/jsnlog.
    • For the JSNLog javascript library add:
      {
        "type": "composer",
        "url": "https://asset-packagist.org"
      }
    • extend your libraries path under installer-path:
      "web/libraries/{$name}": [
        "type:drupal-library",
        "type:bower-asset",
        "type:npm-asset"
      ],
    • add installer-types under extra:
      "installer-types": ["bower-asset", "npm-asset"],
    • and finally:
      composer require bower-asset/jsnlog
  • Manually: Place the module in the modules folder.
    • Download JSNLog library from JSNLog and place the folder under webroot/libraries named jsnlog.
    • (Optional - for better output) Download WhichBrowser library from github and place the folder under webroot/libraries named whichbrowser.
  • Activate and visit settings page.

Options

  • Enable or disable it.
  • Choose logging type: if ajax, console or both.
  • Choose library type.
  • Debug level to save into watchdog.
  • User agent filter to log only specific browsers.
  • Include or exclude roles and or pages.

Usage

If a JavaScript error occurs. The event will trigger an ajax callback and the error will be listed in watchdog.

Troubleshoot

Be beware of your adblocker. This may block the JSNLog script if
aggregation is off, or you use the CDN option.

Custom error triggers

For your custom JavaScript you may want to use some other notifications from the JSNLog library.

JL().warn("warn message");
JL().info("info message");
JL().fatal("fatal message");

Depending on your debug level you configured. These messages will be tracked as well.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
May 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
8.x-1.4 Stable 9–11 Sep 9, 2024
8.x-1.3 Stable Dec 21, 2023
8.x-1.2 Stable May 17, 2023