strapi-plugin-juf-logger
v0.1.8
Published
Substitute to default strapi logger with @sonatel/juf-xpress-logger
Maintainers
Readme
📚 strapi-plugin-juf-logger
“They did what in production?” Now you’ll know. In real time.
Substitute to default strapi logger with @sonatel/juf-xpress-logger
🍷 Elegant. 🔐 Ruthless. ⚙️ Fully Configurable.
Because it’s not just about logging requests—it’s about narrating the admin saga.
🧠 What is it?
strapi-plugin-juf-logger is your audit trail with a backbone.
It tracks everything that happens inside your Strapi Admin, in real-time, with fully configurable rules and zero redeploys.
No more wondering “Who changed that role?”, or “Why is the reset token in my logs?”
You get full visibility, masked data, and total runtime control—without touching a config file.
⚙️ Key Features
✅ Admin UI to rule them all
- Add/delete sensitive fields to mask (
token,password,cookie, etc.) - Map HTTP verbs to semantic actions (
POST → Création,DELETE → Suppression, etc.) - Define action name rules for custom paths (supports dynamic patterns like
/admin/roles/:id)
💥 All live. All without a redeploy.
🧼 Real-Time Redaction
Sensitive keys are automatically obfuscated:
"authorization": "***************"
"res": "***************"
"cookie": "***************"Because your logs should inform, not incriminate.
🗑️ Automatic Delete Audit Trail
Every delete operation is automatically captured with full entity data before deletion:
"http.request.body.content": {
"audit": {
"action": "DELETE",
"uid": "api::article.article",
"documentId": "abc123",
"deletedEntity": { /* full entity snapshot */ },
"timestamp": "2025-04-15T13:14:53.483Z"
}
}No configuration needed. Works out of the box with all Strapi v5+ content types.
🧠 Smart Action Resolution
Logs like:
"event.action": "Création API Token"
"user.name": "[email protected]"
"url.path": "/admin/api-tokens"
"event.type": "AUDIT"All thanks to the dynamic rules engine—built to match patterns, not just strings.
💡 Sample Log Output (Elasticsearch / Kibana-friendly)
{
"@timestamp": "2025-04-15T13:14:53.483Z",
"event.action": "Consultation Other activities",
"event.type": "AUDIT",
"user.name": "[email protected]",
"http.request.method": "GET",
"http.response.status": "OK",
"url.path": "/admin/roles/:id",
"http.request.body.content": { "res": "***************" }
}🧪 Use Cases
- Security Audits
- Role Changes Tracking
- Data Access Monitoring
- Compliance Logging
- Intern Shenanigans Prevention
🛠️ Installation
npm install strapi-plugin-juf-loggerStrapi will auto-load it at startup. No setup needed.
🎯 Custom Audit Data Injection
Need to log additional context beyond the automatic delete tracking? Use ctx.state.audit:
// In any controller, service, or middleware
const koaCtx = strapi.requestContext.get();
if (koaCtx) {
koaCtx.state.audit = {
customAction: 'BULK_EXPORT',
exportedRecords: 150,
requestedBy: '[email protected]',
timestamp: new Date().toISOString(),
};
}The audit data will appear in http.request.body.content.audit in your logs.
🚀 Future Plans (a.k.a. "Why is this not core yet?")
- 💾 Support for external log sinks (Elastic, Loki, CloudWatch)
- 🔄 Replay Mode: reconstruct action sequences
- 🧪 Granular role-based log filtering
🤝 Contributing
Want to help make logs beautiful, actionable, and slightly terrifying?
Open an issue. Or a pull request. Or a bottle of lemonade and start coding.
💌 Built with love (and a little paranoia) by
lpix-11
Let’s be honest.
Strapi didn’t ask for this.
But it needed it.
And now?
Now it logs like a boss. 🪵🔥
