Debugging

From OSF Wiki
Jump to: navigation, search

Different debugging options are available to the OSF for Drupal administrators and developers. All the debugging options discussed in this article are related to debugging the interaction between OSF for Drupal and OSF Web Services. All actions, all operations of OSF for Drupal modules end-up being web service queries to one of the OSF Web Services.


To access the debugging settings, click on the top Configuration menu item. Then, you have to click the Configure OSF for Drupal modules.

OSF for Drupal configurations

Then click the Debugging tab. Now you will see all the configuration options.

Osf debugging.PNG

The two debugging options that are available are:

  1. Display all the calls being made by OSF for Drupal to OSF instance(s).
    1. This will display all the web service calls that are exchanged between OSF for Drupal modules and OSF Web Services. Every time you load a page, if a call is being made to a web service endpoint (except if it is a call to load an entity, see below), then the query will be displayed at the top of the page.
  2. Display loaded Resource Type entities.
    1. This option will display all the CRUD: Read calls that are used by OSF for Drupal to load Resource Type entities. If you enable this option, you will have many more debugging outputs. Also note that if the entity is cached, then no call will appears. To make them appearing, you will have to clear Drupal's cache.

Once you are done, you only have to click Save configuration to save the settings and start seeing debugging information appearing on the website.

Note: Only the administator users will be able to see the debugging output.


Manual Invocation

It is possible to invoke the debugging output without changing the settings, and this, for any Drupal pages. This method also only apply to administrators. If a non-administrator uses this method, that user won't see any debugging output appearing.

The only thing you have to do is to add the wsf_debug=1 parameter to any URL of the Drupal portal.

Debugging Output

Every time a query is exchanged, a box will appear at the top of the Drupal page that is being loaded. The debug box looks like this:

Osf debug output.PNG

Each of these boxes are individual queries sent to one of the OSF Web Services endpoint. The title of the box shows where the query has been sent (which endpoint, and which web service). Then, a series of information is displayed for each query:

  1. url
    1. This is the same information that is in the title of the output; this is the endpoint URL where the query has been sent
  2. method
    1. This is the HTTP method that has been used to send the query
  3. mime
    1. This is the mime type used to send the query
  4. parameters
    1. These are all the parameters that have been used in the query
  5. execution time
    1. This is the execution time of the query in drupal. What that means is that if the query goes to different kind of proxying servers before hitting the real OSF Web Service endpoint, then this proxying time will be included in the execution time displayed to the user. All the network latency will be included as well.
  6. status
    1. This is the HTTP status ID returned by the endpoint's web server
  7. status message
    1. This is the HTTP status message returned by the endpoint's web server
  8. status description
    1. This is the HTTP status message description returned by the endpoint's web server
  9. data
    1. This is the data returned by the endpoint, for that query.
  10. wsq
    1. This is a serialized version of the WSQ object used to send the query. Many more debugging information may be available in this object.