Skip to content

fix: Snowflake SDK stdout log noise corrupts TUI display #304

Description

@anandgupta42

Bug

Snowflake SDK's internal Winston logger leaks JSON log lines to stdout during connection setup, corrupting the TUI display. This is the same root cause as #300.

Example noise:

{"level":"INFO","message":"[12:03:04.357 AM]: Configuring logger with level: -1, filePath: undefined, additionalLogToConsole: undefined"}

Root Cause

Two issues in snowflake-sdk v1.x:

  1. Ordering bug in core.js: Logger.info() fires BEFORE Logger.configure() applies logLevel: "OFF", so one INFO-level message leaks to stdout via Console transport (upstream: SNOW-1800528: Disabling logging without anything being logged to stdout is difficult snowflakedb/snowflake-connector-nodejs#957, fixed in SNOW-1800528 don't log anything if logLevel is set to OFF snowflakedb/snowflake-connector-nodejs#958)

  2. additionalLogToConsole defaults to true: Even with logLevel: "OFF", the Winston Console transport is created by default

Fix

  1. Set additionalLogToConsole: false in snowflake.configure() (defense-in-depth, credit: @saschabuehrle via fix: suppress Snowflake logger noise in TUI output #301)
  2. Bump snowflake-sdk peer dependency from ^1.0.0 to ^2.0.3 (upstream fix for the ordering bug)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions