Interface ZLogging<TInput>

Request logging capability via @run-z/log-z.

Provides request logger means containing ZLogger instance for handlers.

The log messages are actually written to the log under certain conditions. E.g. when request processing error occurred, error logged, or immediate logging triggered explicitly. Once immediate logging triggered, all log messages for the log are recorded to the log, as well as all messages logged after that.

To trigger immediate logging add immediate property with truthy value to log message details like this:

context.log.info('Immediate message', zlogDetails({ immediate: true }));

Type Parameters

  • TInput = unknown

    A type of request processing means required in order to apply this capability.

Hierarchy

  • RequestCapability<TInput, LoggerMeans<ZLogger>>
    • ZLogging

Methods

Methods

  • Combines this capability with the next one.

    Type Parameters

    • TNext

      A type of extension to request processing means applied by next capability.

    Parameters

    • next: RequestCapability<TInput & LoggerMeans<ZLogger>, TNext>

      Next capability that receives requests modified by this capability.

    Returns RequestCapability<TInput, LoggerMeans<ZLogger> & TNext>

    New request processing capability that applies modifications to request by this capability first, and then - by the next one.

    See

    RequestCapability.combine

  • Provides request processing capability to the given handler.

    Builds request processing handler that modifies request and delegates to target handler.

    Type Parameters

    • TMeans

      A type of request processing means expected by constructed handler.

    Parameters

    • handler: RequestHandler<TMeans & LoggerMeans<ZLogger>>

      Request processing handler that will receive modified request context.

    Returns RequestHandler<TMeans>

    New request processing handler.

  • Configures request logging.

    Type Parameters

    • TNewInput

    Parameters

    Returns ZLogging<TNewInput>

    A logging capability with the given configuration applied.

Generated using TypeDoc