• This middleware will log Request/Response details. It can be controlled by setting a corresponding operation mode to the process.env.EXTENDED_REQUEST_LOGGING ENV var of the service.

    The following modes are supported:

    • OFF (or when a the ENV var is undefined, which is the default) = Disables the extended logging
    • ERRORS_ONLY = Enables the logging if the res.code >= 400 OR res.body fits a standard GQL error shape
    • ALL = Enables the logging of every request/response, be it successful or error.

    TODO: Introduce an operation mode for logging only at some intervals, for when we don't need to log every single req/res during high load.

    Parameters

    • _config: ValueObject<{
          environment: (() => "test" | "development" | "production");
          fullDevLogs: (() => boolean);
          healthEndpointPort: (() => number);
          isDev: (() => boolean);
          isProd: (() => boolean);
          logLevel: (() => "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE");
          logMaskKeywords: (() => string[]);
          logMaskMaxDepth: (() => number);
          secureLoggingMode: (() => MaskMode);
          serviceId: (() => string);
      }>

    Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

Generated using TypeDoc