Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

RESTful Logger

Security covered Maintenance fixes only 39 sites

This module creates a REST endpoint that allows you to log messages to Drupal's database log. You can send log entries as JSON data, specifying the message, its severity, the path, and the channel. This provides a programmatic way to record information in Drupal's watchdog log.

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

Drupal 10–11

Ask your assistant about RESTful Logger

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • rest Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Apr 2023
Latest release
2 weeks ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.3 Stable 10–11 Oct 28, 2026
2.0.2 Stable 10–11 Aug 29, 2024
2.0.1 Stable 8–11 Apr 5, 2023