Increasing Recent Requests in the Felix Console

Increasing Recent Requests in the Felix Console

I argued with myself for some time before commiting to writing this post.  Part of me thought it kind of silly to post such a thing.  Then I reflected on the hour or so I wandered around trying to figure out how to get this darned thing to do what I needed it to.  So, now you won't have to wonder how the heck to get this to work properly.  This was tested on CQ 5.5 SP1, but that does not necessarily mean it wont work on other versions as well.

When reverse engineering components, one of the native Felix tools I use is the "Recent Requests" (/system/console/requests) tool in the Felix console.  The issue is that the maximum of 20 requests is frequently not enough to capture - say a form post.  Twenty requests basically showed me all of the image requests, but none of the form field requests.

The "Recent Requests" tool shows information that is gathered by the Sling Engine for each individual request that is made to Sling.  When a page renders - externally there is a single HTTP request that is handled by Sling.  However, when the HTML for the page is composed server side, there are MANY internal Sling requests - one for every single component that is related to the "current" page.  This could result in 10, 20, or 134 Sling requests - each of which will be "logged" internally by Sling capturing information about the request.  Look at the "Recent Requests" tool after requesting the Geometrixx homepage and you will immediately see what I am talking about. 

It took me some time to remember how to configure Sling to record more than 20 requests, and I then remembered why I abandoned trying to modify this default value the last time I tried.  I simply had not taken the time to figure out what I did "today".  The configuration is not in a place that is intuitive to me and took some digging around (about 45 mins worth of digiing).

The first change that needs to be made is in /system/console/configMgr under "Apache Sling Main Servlet".  Click on the edit icon, which will pop open the edit dialog.  My FAIL #1 was simply setting the "Number of Requests to Record" value to 200 and clicking "Save".  Now when refreshing "Recent Requests" it now shows me NOTHING.  What the heck!!

After restarting CQ, stopping and restarting the bundle this component resides in - still NOTHING.  FAIL #2 and FAIL #3.

On a whim, I tried changing "Recorded Request Path Patterns" to   /.*    and saved the configuration.  I can now breathe a sigh of relief.  Sling now dutifully records a maximum of 200 requests which I can now drill into to see what is going on behind the scenes.

IF I had to guess what is going on - I would guess that overriding a single value requires you to override them all - or at least the path field.

Enjoy.

Share this post

0 Comments

comments powered by Disqus