Drupal AI Ecosystem Part 2 - AI Logging, Observability, & API Explorer
In the first part of our series, we explored the foundational architecture, setting up the Drupal AI Ecosystem and AI CKEditor module. In this follow-up, we’ll take a hands-on look at the other three vital submodules that power robust, production-grade AI features: AI Logging, AI Observability, and the API Explorer.
These elements provide transparency, simplify debugging, and allow for safe experimentation within the Drupal AI ecosystem, enabling you to keep confidence and control while scaling AI throughout your site.
As AI integrates more tightly into web content infrastructure, questions of transparency, reproducibility, and operational trust become increasingly critical.
Logging, observability, and real-time testing are not nice-to-haves; they’re fundamental requirements for responsible AI adoption in editorial and customer-facing environments.
In this article, we will discuss three modules that directly meet those needs in any Drupal setup, enhancing the overall Drupal AI ecosystem.
Before going further into the Drupal AI Ecosystem, discover how our AI knowledge can assist you in effectively implementing these modules and turning your Drupal site into a smart, data-driven experience.
Drupal AI Ecosystem: AI Logging Module
Purpose
The AI Logging module tracks every AI model invocation (requests and responses) processed by the Drupal AI system. It captures metadata such as the prompt, model/vendor used, contextual parameters, timestamps, user ID, and the full or redacted output.
This establishes a reliable audit trail for all AI interactions, which is essential for compliance, troubleshooting, cost tracking, and governance in the Drupal AI ecosystem.
Why You Need It
- Debugging: Easily pinpoint where prompts or outputs aren’t meeting editorial expectations.
- Audit & compliance: Prove what AI-generated content was produced, by whom, and when.
- Usage monitoring: Track API consumption (including token counts and cost, depending on provider feature support).
- Security: Detect anomalous or abusive usage patterns.
Feature Tour
- Granular configuration: Log content, parameters, errors, and metadata. Optionally redact sensitive info for privacy.
- Log storage: Logs are written to dedicated database tables accessible via Drupal’s admin interface or, optionally, exported.
- Admin UI: Search/filter logs by date, model, user, or error status for rapid investigation.
- Permissions: Govern who can view logs or export raw data using standard Drupal roles and permissions.
How to Install
Enable module:
drush en ai_logging
drush cr
How to Configure
Once the module is enabled, you will see the AI Logging option in the AI Menu.
Navigate to Configuration → AI → AI Logging → AI Logging
Settings (/admin/config/ai/logging/settings).

Enable “Automatically Log Requests”.
You can also configure the number of log messages to retain in the database and the retention period. You can set values as required. Now, let’s perform an operation using AI and generate some content using the AI CKEditor.

Check the logs at Configuration → AI → AI Logging → AI Logs (/admin/config/ai/logging/collection).

If you examine this closely, you will see a default prompt alongside the user-provided prompt. And since the output is directly streamed, you will not see the output here.

Let’s try another case to fix spellings using AI inside CKEditor.
- Enabled the “Fix Spelling” CKEditor plugin.
- Make some spelling mistakes inside the CKEditor content.
- Select the text on which you want to run this operation. And click on AI Assistant & select Fix Spellings. Click the Fix Spelling button. You will receive the corrected response from AI.

Here’s the log for this request.

AI Logging also provides the option to create bundles (types) of logs and define fields in them, which can be used to log custom additional data for the request. By default, all logs are logged with type “Generic”. This flexibility makes AI Logging an integral part of the Drupal AI ecosystem for maintaining transparency and reliability.
Also Check Out:
- Drupal AI Ecosystem Part 1: Setup and AI CKEditor Configuration
- Transform Your Website with Drupal AI Module in 2025
- Create and Integrate: CKEditor 5 Plugin in Drupal 11
- Ethical AI Chatbot: Implementing the RAIL Framework at OSL
Drupal AI Ecosystem: AI Observability
Purpose & Distinction from Logging
The AI Observability module logs all calls to AI providers and captures metadata to help monitor, audit, and manage AI usage. You can use these logs to track token consumption per user, per provider, or per operation type to understand patterns and identify heavy users. This capability enhances visibility across the Drupal AI ecosystem, ensuring performance and accountability.
- Enable module:
drush en ai_observability
drush cr
Configuration
Go to Configuration → AI → AI Observability.
Select the events that should be logged and save the settings. (You can set the tags that should be used for logging, which can help in filtering and reporting.)

It will log entries for requests in the Drupal DB Logs. I have operated to rephrased a paragraph:

You will find several entries for AI Observability in the logs. One of these will show the number of tokens used in the request. As shown in the screenshot below, 264 tokens were used. Therefore, this module is useful for monitoring requests and token usage, essential for grasping AI efficiency in the Drupal AI ecosystem.

As suggested by this module and the community, you can use the Extended Logger module to store and view the logs with a better UI and filtering options.
Drupal AI Ecosystem: AI API Explorer
Purpose: Safe Experimentation
This module is an exciting addition for anyone exploring AI integration in Drupal! It offers a variety of handy forms that let site builders experiment with different API calls and even generate boilerplate code to recreate those calls within custom modules. It’s designed primarily for development purposes—perfect for testing prompts and responses with your chosen LLM.
The forms available change automatically according to the modules and AI providers you have set up. Additionally, as you grow your configuration, other modules can introduce their own forms, which increases flexibility. This connection makes the API Explorer an essential tool for experimentation in the Drupal AI ecosystem.
Installation
drush en ai_api_explorer
drush cr
Configuring & Using API Explorer
Find it at Configuration → AI → AI Observability (/admin/config/ai/explorers).
You will see a list of different Explorers. Let’s start with Chat Explorer.

You will also see the code that is being called executed in the BE for this request. You can use this code snippet to write custom code to generate an AI response for various business use cases.
You can experiment with various contexts using providers and models, adjusting tones to achieve optimal results for different applications. This practical exploration is what makes the Drupal AI ecosystem flexible and prepared for the future.
How These Modules Work Together
When combined, AI Logging, AI Observability, and the API Explorer form a powerful operational backbone for managing AI in Drupal:
- API Explorer empowers developers and site builders to safely prototype and test AI interactions before deploying them.
- AI Logging ensures every AI interaction is recorded with full traceability, supporting compliance, debugging, and governance.
- AI Observability provides real-time insights into usage patterns, token consumption, and system behavior, enabling proactive monitoring and optimization.
Together, these modules bring transparency, control, and agility to your AI workflows. They transform AI from a mysterious backend process into a well-governed, observable, and testable part of your digital experience stack. Whether you're scaling AI across editorial workflows or experimenting with new capabilities, this trio ensures you're doing it responsibly and efficiently.
What’s Next?
With a solid foundation in place, Part 3 of this series will explore AI Content Translation, unlocking the power of multilingual content delivery in Drupal. We’ll dive into how AI can help you translate content at scale, maintain tone and context across languages, and streamline global content operations.
Stay tuned as we continue to build a smarter, more inclusive Drupal experience, powered by AI.
Also Check Out:
- DrupalCon Vienna Key Takeaways: Transforming Drupal with AI
- GenAI vs LLM: What’s the Real Difference?
- UX Best Practices for Website Integrations
- Gin Admin Theme: Replacing Claro In Drupal CMS
Key Takeaways
- The Drupal AI Ecosystem enables transparent and scalable AI operations, combining modules like AI Logging, Observability, and API Explorer to ensure accountability in every AI interaction.
- AI Logging establishes a strong audit trail for all AI requests and responses, helping teams with debugging, compliance, and performance tracking across Drupal-powered sites.
- AI Observability delivers real-time visibility into AI usage by tracking requests, token consumption, and performance metrics.
- The AI API Explorer empowers safe experimentation, allowing developers to prototype, test, and refine AI prompts or integrations before full-scale deployment.
- Together, these modules form the backbone of a responsible Drupal AI Ecosystem, enabling site builders to innovate faster while maintaining transparency.
Subscribe
Related Blogs
DrupalCon Vienna Key Takeaways: Transforming Drupal with AI
Dries delivered his 43rd keynote at DrupalCon Vienna! “AI is the storm… but instead of turning away, we need to embrace AI…
Drupal AI Ecosystem Part 1: Setup and AI CKEditor Configuration
The Drupal AI modules smoothly incorporate artificial intelligence into the Drupal ecosystem, viewing AI as a fundamental…
Transform Your Website with Drupal AI Module in 2025
Drupal is quickly progressing in Artificial Intelligence with the creation of the Drupal AI Module and the upcoming Drupal…