log_plotly_chart
Log Plotly Chart
This module displays a real-time, dynamic line chart featuring the latest database log entries (from Drupal's core `dblog` module) using a completely local installation of the Plotly.js library.
Instead of showing a single messy timeline, the module automatically processes and splits the logs into separate, independent lines (traces) based on their category type (e.g., `php`, `cron`, `user`, `content`, `page not found`). It also features an interactive legend on the right side that allows administrators to show or hide specific log types in real-time.
---
Requirements
Drupal 11 core.
Core Database Logging (dblog) module enabled (writes events to the local watchdog table).
Installation & Library Manual Setup
To keep this module lightweight and independent of third-party wrappers or network-dependent CDNs, the Plotly JavaScript asset must be placed locally in the file system:
Create a plotly subdirectory inside your global Drupal root libraries folder:
/libraries/plotly/
Download the official production-ready minified Plotly script (plotly-latest.min.js) from the official project distribution channels:
Direct Download Link: https://cdn.plot.ly/plotly-latest.min.js
Move that file into the directory you just created. The final path must match this exact pattern:
/libraries/plotly/plotly-latest.min.js
Enable the Log Plotly Chart module from your Extend administrative interface (/admin/modules) or using Drush:
Bash
drush en log_plotly_chart
Directory Structure
blueprint of the complete module package:
```text
modules/custom/log_plotly_chart/
├── log_plotly_chart.info.yml
├── log_plotly_chart.libraries.yml
├── log_plotly_chart.routing.yml
├── log_plotly_chart.links.menu.yml
├── log_plotly_chart.module
├── README.md
├── config/
│ └── install/
│ └── log_plotly_chart.settings.yml
├── css/
│ └── log_chart.css
├── src/
│ ├── Form/
│ │ └── SettingsForm.php
│ └── Plugin/
│ └── Block/
│ └── LogChartBlock.php
└── js/
└── log_chart.js