Interface RequestZLogConfig<TInput>

Logger configuration.

Type Parameters

  • TInput = unknown

    A type of incoming request processing means.

Hierarchy

  • RequestZLogConfig

Properties

Methods

Properties

by?: ZLogRecorder

A log recorded to log messages by.

Default

Console log recorder.
immediate?: ZLogLevel

A log level causing immediate logging.

Once a message with this level is logged, then all messages logged during the same request processing are recorded to the log. Both logged before and after.

Default

Error level.

Methods

  • Builds a logger for the request.

    This method is called for each request. The log recorder returned by it is used to build a request logger available via LoggerMeans.

    The logging is ended after request completion.

    Parameters

    • logger: ZLogRecorder

      Global log recorder.

    • context: RequestContext<TInput>

      Request processing context to build the logger for.

    Returns ZLogRecorder

    A log recorder to use to log request processing messages.

  • Logs an error occurred during error processing.

    Logs the error as an error detail.

    Parameters

    • context: RequestContext<TInput & LoggerMeans<ZLogger> & ErrorMeans<any>>

      Error processing context with logger means.

    Returns void | PromiseLike<unknown>

    Either nothing if error logged synchronously, or a promise-like instance resolved when error logged asynchronously.

Generated using TypeDoc