Libraries
    Preparing search index...

    Function createLogger

    • Creates a structured logger with the specified configuration.

      The logger uses fire-and-forget semantics — log methods are synchronous and push events into an internal async pipeline. Events flow through enrichers, filters, and level overrides before being dispatched to sinks.

      Parameters

      • config: LoggerConfig

        logger configuration including sinks, enrichers, and filters

      Returns Logger

      a configured Logger instance that implements AsyncDisposable

      const logger = createLogger({
      minimumLevel: 'information',
      sinks: [consoleSink({ theme: 'dark' })],
      enrichers: [hostnameEnricher()],
      });

      logger.info('Server started on port {Port}', { Port: 3000 });