Application Logging

Application Logging

The N2ACD GUIs may be configured so that error messages are not sent to clients. Errors can be suppressed and recorded only in the Apache application log files. Any error that a customer receives will only contain a tailored note with a unique identifier that will allow administrative staff the ability to locate the complete error message within the application logs.

The app configuration within the N2ACD application configuration files (/etc/jarvis/n2acd-admin.xml and /etc/jarvis/n2acd-fe.xml) can be edited to alter the following described configuration.

For further information and app configuration options consult the Jarvis Development Guide.

<app 
    use_placeholders="yes"
    format="json.rest" 
    debug="no"
    dump="no"
    error_response_format="[%T][%R] please contact 0800 NSQUARED and provide this error code."
    log_format="[%H][%P/%A/%U/%D][%R] '%S' %M"
>
Option Description
use_placeholders Must be set to yes.
format Must be set to json.rest.
debug May be set to yes or no. When set to yes the Apache error log (normally /var/log/httpd/error_log) will have debug information written to it when requests are processed by GUI APIs.
dump May be set to yes or no. When set to yes the Apache error log will have query data dumped to it. It is recommended this is set to no in production.
error_response_format The sanitized response provided to the GUI when an error occurs on the server-side.
log_format The format of the log to be included in the Apache application log when an error occurs on the server-side.

Log Formating Options

The logging output string log_format is constructed by using a number of substitutions parameters. Each parameter substitutes values into the constructed output string. The definitions of each are as follows:

Key Description
%T Time the request was received, in the format [18/Sep/2011:19:18:28 -0400]. The last number indicates the timezone offset from GMT.
%H The request protocol.
%P The process ID of the child that serviced the request.
%A Local IP-address.
%U The URL path requested, not including any query string.
%D The time taken to serve the request, in microseconds.
%R Unique UUID for the request.
%S Session ID for the request.
%M The request method.

By defining the error_response_format to only print %T (time stamp) and %R (UUID) we can avoid leaking internal server methods to any potentially malicious clients. Any user that encounters an error simply needs to provide the time stamp and UUID and the full stack trace can be located within the server-side logging file.