A registry for creating named Loggers.

interface LoggerProvider {
    getLogger(
        name: string,
        version?: string,
        options?: LoggerOptions,
    ): Logger;
}

Implemented by

Methods

Methods

  • Returns a Logger, creating one if one with the given name, version, schemaUrl, and attributes is not already created.

    Getting a Logger may be expensive, especially when attributes are provided. Reuse Logger instances where possible instead of calling getLogger() on hot paths.

    Parameters

    • name: string

      The name of the logger or instrumentation library.

    • Optionalversion: string

      The version of the logger or instrumentation library.

    • Optionaloptions: LoggerOptions

      The options of the logger or instrumentation library.

    Returns Logger

    Logger