@nebius/js-sdk - v0.2.54
    Preparing search index...

    Function defaultHandler

    • Creates a log handler from options and Nebius logging environment variables.

      Explicit scalar options override their matching environment settings. Important settings include NEBIUS_LOG, NEBIUS_LOG_JSON, NEBIUS_LOG_ALWAYS_ADD_TRACE, and NEBIUS_LOG_OUTPUT.

      Per-name variables add environment filters. The suffix is matched with a case-sensitive loggerName.includes(suffix) check. For example, NEBIUS_LOG_auth=DEBUG matches nebius.auth. If opts.filters is present, the environment filters are added to it; they are not replaced. A per-name filter cannot lower the handler's global minimum level. To emit debug records, also set NEBIUS_LOG=DEBUG or pass level: Level.DEBUG.

      Without explicit output, NEBIUS_LOG_OUTPUT accepts stderr, stdout, console, none, or a file path. Color selection also follows NO_COLOR, FORCE_COLOR, and whether stderr is a terminal.

      Parameters

      Returns Handler

      import {
      defaultHandler,
      Level,
      Logger,
      } from '@nebius/js-sdk/runtime/util/logging';

      const handler = defaultHandler({
      level: Level.DEBUG,
      useJson: true,
      filters: ['nebius.auth', 'nebius.request'],
      });
      const logger = new Logger(handler, 'nebius.request');