Problem/Motivation

A few items:

  • Out of the box Search API Solr Devel doesn't show the Solr responses/debugQuery on screen.
  • The logged requests have no timestamp or context which helps link them with their original requests.
  • The information logged into the temporary://drupal_debug.txt file has a lot of the extra HTML format applied to it (if the Devel logger plugin is not the "default" one.
  • Many Solr queries are "pings" that end up cluttering the screen.(Example: navigate to /admin/config which apprently triggers a lot of eventual calls to Solr).

Proposed resolution

  • Show responses on-screen.
  • Add a datetime to each message, plus measure and show the Solr response time.
  • Force the information written to temporary://drupal_debug.txt to use the default logger (which avoids a lot of HTML cruft)
  • Avoid logging all "admin/*" Solr requests.

Incoming patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

janusman created an issue. See original summary.

janusman’s picture

Status: Active » Needs review
FileSize
4.38 KB

Patch for review.

janusman’s picture

mkalkbrenner’s picture

Status: Needs review » Needs work

The patch looks good. It just requires some small adjustments:

  1. +++ b/modules/search_api_solr_devel/src/Logging/SolariumRequestLogger.php
    @@ -78,12 +130,23 @@ class SolariumRequestLogger implements EventSubscriberInterface {
    +    $debug = [
    

    The counter should be included here to build a relationship to the response.

  2. +++ b/modules/search_api_solr_devel/src/Logging/SolariumRequestLogger.php
    @@ -93,10 +156,29 @@ class SolariumRequestLogger implements EventSubscriberInterface {
    +    $debug = [
    

    The counter should be included here to build a relationship to the request.

  3. +++ b/modules/search_api_solr_devel/src/Logging/SolariumRequestLogger.php
    @@ -93,10 +156,29 @@ class SolariumRequestLogger implements EventSubscriberInterface {
    +      'Solr response body' => Json::decode($response->getBody()),
    

    Json:decode should not be used here!
    It is possible to request a different response format from Solr.

janusman’s picture

Thanks for the feedback! Will post changes soon.

janusman’s picture

Status: Needs work » Needs review
FileSize
4.43 KB
210.23 KB

New patch.

Added counter to debug dump. Removed use of Json::decode().

Updated PR at https://github.com/mkalkbrenner/search_api_solr/pull/66/commits/f518963d... (checks are running).

Glad I removed the Json::decode() bit, because I discovered the vardumper output would quite inconveniently cut off display of the explain output (which is now visible by looking at the raw Json).

Added screenshot of how this looks when using the Symfony VarDumper option set in /admin/config/development/devel

mkalkbrenner’s picture

Status: Needs review » Reviewed & tested by the community

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.