BxLens for ColdBox

On this page

BxLens for ColdBox

ColdBox{ width=64 }

BxLens understands ColdBox. When your application is a ColdBox application, BxLens finds it by itself and shows what ColdBox does for every request. You install nothing in your application and you change no file.

You getWhere
A ColdBox tab: the route, event, handler, layout and view, how many views rendered and which ones more than once, the time of each view and layout in a waterfall, and the state of the event cacheThe bar
The ColdBox tag and the event on every request, and a filter by tagRequests
The events, views and layouts in the Timeline, with the queries that ran inside themTimeline
Buttons to clear the event and view caches and to reinit the frameworkThe bar
The ColdBox version next to the applicationApplications
A ColdBox page in the console: overview, composition, modules (timeline, tree, table and which version loaded), schedulers and tasks, CacheBox caches and executorsThe ColdBox page
Findings of the Advisor, in the bar and in the console, free. With BoxLang+, Find solution asks Lensy for a prompt for your coding agentFindings
Task groups and meta, for BoxLang and ColdBox tasks, free. Run, pause, resume and remove need BoxLang+Tasks
Boards on the Reports page: what to look at first, for the whole server and for your applicationReports
Help icons and a Glossary for every termGlossary
Lensy tools to read the application and, with your approval, to act on itLensy tools

Watch the ColdBox walkthrough for a tour with a voice and captions.

How it works

  1. At the start of each request BxLens looks for application.cbController, where ColdBox keeps its controller.
  2. If it finds one, BxLens registers one interceptor of its own in that ColdBox application, with ColdBox's own interceptor service. It is the same mechanism a ColdBox module uses, and nothing in your files changes.
  3. The interceptor tells BxLens, for each interception point, which event ran, which view or layout rendered and how long it took. It sends names, numbers and flags, never the values of rc or prc.
  4. ?fwreinit makes ColdBox build a new controller. BxLens sees the new one on the next request and registers again.

There is nothing to switch on. The support is on by default and does nothing until a ColdBox application is found. Turn it off with collectors.coldbox.enabled.

The console page

The console has a ColdBox page: overview, composition (routes, handlers, interceptors), modules with a timeline, a tree and a duplicate-version check, CacheBox caches and executors.

What it costs

At collect.level light (the default) BxLens uses three interception points of ColdBox and reads the request facts once at the end. At full it also times every event, view and layout. Both are small next to the work a request does, and the data is dropped with the request.

Replacing cbdebugger

The ColdBox debugger shows a panel at the end of each request in development. BxLens shows the same facts, and it is safe to leave on in production because it is only shown to the callers you allow and it never records the values of rc or prc.

cbdebuggerBxLens
Request profiler listThe Requests page with the ColdBox tag and event
Timers for events, views and layoutsThe ColdBox tab waterfall and the Timeline
Route, event, view and layout of the requestThe ColdBox tab
rc and prc collectionsThe names of the keys, never the values
SQL panels for qb, Quick and cbormThe Queries tab sees every query, whatever library ran it
CacheBox monitor: clear events and viewsClear event cache and Clear view cache in the bar
Debug mode and passwordbar.access, which says who sees the bar. There is nothing to turn on

You can run both. If you only want BxLens, remove cbdebugger from the application.

Other frameworks

ColdBox is detected by itself. Any other framework, module or application can tag its requests and name its framework with lensTag and lensFramework, or from an interceptor with the extension API. A tagged request shows its tag in the Requests page and can be filtered by it.

Limits

  • ColdBox 7 and 8.
  • BxLens records the keys of rc and prc, not their values. There is no setting to turn the values on.
  • The request is recorded from ColdBox's interception points. A request that never reaches ColdBox (a static file, a redirect before ColdBox starts) has no ColdBox data.