Laminas Lens: SQL query logging for Laminas MVC

Lens logs all SQL queries in your application with timings, binding values, and traces, and offers an interface at /lens to review performance. Quick installation with composer.

sábado, 16 de agosto de 2025 • 2 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Have you ever wondered what database queries your application is executing right now? When performance degrades, searching through the code can be painful. That's why we created Lens, a compact package that logs every SQL query with timings, parameters, and a simple interface to review what's happening.

What Lens does: • Logs all database queries in your application including execution time, binding values, and stack trace • Clean interface accessible at /lens to explore and search queries • No complex configuration: install and you're done

Quick installation: composer require askerakbar/lens

Example configuration to add to the module: lens: storage: type database; table lens_logs (optional, defaults to lens_logs)

When running the application you'll get query logs like: SELECT * FROM products WHERE category_id = 10 (15 ms)

Status and compatibility: Lens is in development. It has been tested on Laminas MVC 3.7 with PDO_MySQL and is intended solely for development environments and targeted assistance in existing projects, especially considering the transitional state of Laminas MVC.

GitHub repository: https://github.com/askerakbar/lens

About Q2BSTUDIO: we are a software development company specialized in custom applications and custom software. We offer comprehensive solutions including artificial intelligence, AI for businesses, and AI agents to automate processes and improve decision-making. We are also experts in cybersecurity to protect your data and AWS and Azure cloud services to deploy and scale applications reliably. Additionally, we provide business intelligence services and Power BI consulting to turn data into actionable insights.

How Q2BSTUDIO can help with Lens and your project: • Integration and customization of monitoring and query logging tools • Database performance optimization and bottleneck analysis • Implementation of artificial intelligence solutions and AI agents that interact with your data • Cybersecurity auditing and reinforcement in applications and APIs • Deployment on AWS and Azure cloud services and scalable architectures • Dashboards and control panels with Power BI and business intelligence services

If you're looking to speed up diagnosing performance issues or want a custom solution that combines monitoring, AI, and security, at Q2BSTUDIO we have the experience to help you implement Lens as part of a complete observability strategy. Contact us to evaluate your case and design the right solution.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.