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.
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Administration tools, Developer tools
153 sites report using this module
- Created by westberliner on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
8.x-1.4
released 9 September 2024
Works with Drupal: ^9 || ^10 || ^11
Drupal 11 Support
Install:
Development version: 8.x-1.x-dev updated 28 Jul 2025 at 18:26 UTC

