Application Logging

Application Logging

N2FE can 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 primary N2FE application configuration file /etc/jarvis/n2fe.xml can be edited, using the following example.

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
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 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.