title: How can I properly add CakePHP's Debug Kit to a reporting tool?
body: <p>I'm new to Debug Kit and spent this day with studying it, looking at its source-code, reading about it to gather as much information as possible. Even though I'm not an expert about this plugin, I think I'm ready to ask a question here on SO about it.</p>
  <p>Documentation link: <a href="https://book.cakephp.org/debugkit/4/en/index.html" rel="nofollow noreferrer">https://book.cakephp.org/debugkit/4/en/index.html</a></p>
  <p>While working on a group of inter-related projects, I was asked to look into ways to add a SQL debugger/logger feature hopefully along with a UI, using the model of an already existent solution at a project.</p>
  <p>While looking into this tool, I have found out that it is CakePHP's Debug Kit, with some project-specific customizations.</p>
  <p>Now, introducing it into the problem-space I was asked is an interesting problem, because it is a reporting problem-space which works as follows:</p>
  <ul>
  <li>the user sets up what reports are needed</li>
  <li>once the user completes setting up the report, finalizes it and issues the command to generate it</li>
  <li>the report enters a report queue</li>
  <li>once the report arrives to the head of the queue, it is processed</li>
  <li>while it is processed, potentially many SQL operations are being executed</li>
  <li>once the report's processing finalizes, a file is generated on the server</li>
  <li>the user can later visits his/her reports</li>
  <li>they are displayed as entries in a UI where they can be downloaded</li>
  </ul>
  <p>What I would like to profile and benchmark is what happens when the report is at the head of the queue and is being processed.</p>
  <p>Even though in this case many physical server machines and different databases may be involved, from the perspective of this question this kind of complexity is irrelevant, I'm happy to handle it. Let's simplify it and assume for the sake of simplicity that I have a reports table and each report has its own ID.</p>
  <p>I would like to use Debug Kit as follows:</p>
  <ul>
  <li>log all MySQL commands while the report is being generated</li>
  <li>knowing somehow the report ID it is to be linked to</li>
  <li>when I load the reports page, I would like to have some button or whatever UI tool that I can use to open a dialog where the benchmarking/profiling information is being displayed</li>
  <li>ideally I would like to have such a UI tool for all report titles shown on the UI, if I have to implement my own UI for this purpose, then I'm happy to do so</li>
  <li>I would also like to add custom logs to this profiler/benchmarker, like the notification of the status of the report or that a complex operation has started/finished</li>
  </ul>
  <p>My question is as follows: <strong>Is there a way to use Debug Kit in the use-case I have described above and if so, how?</strong></p>