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:
Recommended 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
- Enable the module at Administration > Extend.
- Grant the desired permissions needed to the
POST log messagespermission and theAccess POST on Watchdog database logger resourcepermission via the People > Permissions page.
Example JSON POST Body
Required Values:
- message
- path
Default Values:
- The default value for
channelisrestfulloger. - The default value for
severityisNotice.
{
"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 messagesandAccess POST on Watchdog database logger resourcepermissions 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
messageandpathvalues are defined.
Credits
Supporting organizations:
Funding developement
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Decoupled, Developer tools, Integrations
- Ecosystem: Drupal core, RESTful Web Services
31 sites report using this module
- Created by rymcveigh on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
