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.

Synopsis

This module provides a REST endpoint for logging messages to Drupal's core logger using JSON with a message value, severity, path, and channel value as documented on the Drupal Logging API documentation.

Requirements

This module requires the following core modules:

  • REST UI module: When enabled, it displays active REST endpoints at Configuration > Services > REST.

Installation

Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.

Configuration

  1. Enable the module at Administration > Extend.
  2. Grant the desired permissions needed to the POST log messages permission and the Access POST on Watchdog database logger resource permission via the People > Permissions page.

Example JSON POST Body

Required Values:

  • message
  • path

Default Values:

  • The default value for channel is restfulloger.
  • The default value for severity is Notice.
{
  "message": "The message you want to log.",
  "severity": "Error",
  "channel": "module_machine_name",
  "path": "/path/to/page"
}

Troubleshooting

If the logger does not get recorded when POSTing to /dblog/logger

  • Ensure the POST log messages and Access POST on Watchdog database logger resource permissions are set to the correct roles on the People > Permissions page.
  • Ensure the REST endpoint is enabled. (This is easier to check using the REST UI module.)
  • Ensure your JSON body is formatted correctly and the message and path values are defined.

Credits

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
2
Tracked since
Apr 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Active

Releases

Version Type Core Release date
2.0.2 Stable Aug 29, 2024
2.0.1 Stable Apr 5, 2023