Web-Server Debug

Troubleshooting - Web-Server Debug

In general, when an N2C5 server-side function (e.g. a plugin module) fails to operate correctly, it should always generate an error message to the apache error log file.

However, there may well be cases where you wish to view additional information about the plugin processing. For example you may wish to understand more about what the module was doing before the error occurred. Alternatively, the plugin might be returning with zero rows of data, rather than an actual error.

In such cases, it may be instructive to enable Jarvis debug/dump output. Currently this can be done in two ways:

  1. Global Jarvis dump/debug.
  2. Single Dataset/Plugin Jarvis dump/debug.

The mechanism for doing this is fully described in the Jarvis documentation. However, the key points are summarised here for convenience.

Global Dump/Debug

To enable Global Jarvis Dump or Debug, edit the relevant Jarvis application configuration file, e.g:

/etc/jarvis/n2c5-model.xml

Inside the <app> tag are the global debug and dump flags.

<jarvis>
    <app use_placeholders="yes" format="json" debug="no" dump="no" log_format="[%P/%A/%U/%D] %M">

To activate global basic debug, configure debug=“yes”. To activate an even more detailed global dump output, configure dump=“yes”. For example:

<jarvis>
    <app use_placeholders="yes" format="json" debug="yes" dump="no" log_format="[%P/%A/%U/%D] %M">

Note: Enabling dump mode will force debug mode to be enabled also.

Note: Naturally you should take a backup copy of any configuration file before making any manual changes.

Note: It is not necessary to restart any processes for this configuration change to take effect. All subsequent requests will immediately use the new debug/dump flag values.

Note: Enabling global debug or dump output for N2C5 will very likely cause a noticeable increase in page load times. This should not generally be performed in a production environment, especially at peak times.

Note: The N2C5 Jarvis application configuration file is an XML format file. If you create an invalid XML file, then all N2C5 dynamic data requests will fail and the N2C5 application will not function until the syntax error is corrected.

Per-Dataset/Plugin Dump/Debug

Enabling global debug/dump in an operational environment is not generally advisable. The additional page load times will typically be noticeable. Also, the amount of debug output generated by a system under operational load will typically be so overwhelming as to be impractical.

Instead, it is usually more pragmatic to enable dump/debug for a single plugin. This is done simply by setting debug=“yes” in the plugin configuration. E.g.

<plugin dataset="rate-table-info" access="*" module="RateTableInfo"
    add_headers="yes" mime_type="application/json"/>

Becomes:

<plugin dataset="rate-table-info" access="*" module="RateTableInfo"
    debug="yes" add_headers="yes" mime_type="application/json"/>

Note: Enabling debug or dump for a single plugin may cause a noticeable delay in page load times. This feature should be used with care in an operational environment.