Skip to content

SNOW-1800528: Disabling logging without anything being logged to stdout is difficult #957

Closed

Description

@visnup

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of NodeJS driver are you using?
    1.15.0

  2. What operating system and processor architecture are you using?
    darwin arm64

  3. What version of NodeJS are you using?
    v20.18.0

  4. What are the component versions in the environment (npm list)?
    N/A

  5. What did you do?

snowflake.configure({logLevel: "OFF"});
  1. What did you expect to see?

No logging to stdout anywhere. Instead, I see the message

{"level":"INFO","message":"[2:27:54.321 PM]: Configuring logger with level: -1, filePath: undefined, additionalLogToConsole: undefined"}

logged to console/stdout before it finally turns off. This seems to defeat the purpose of silencing logging to stdout. This is important to me because the output to my program (querying Snowflake) is used as input to another process, and the downstream process is confused by seeing Snowflake logging output.

As a workaround, I've instead done

import Logger from "snowflake-sdk/lib/logger.js";
Logger.getInstance().configure({level: -1});

but this isn't documented anywhere. Other workarounds like setting additionalLogToConsole to false doesn't work because a log file isn't set, and setting logFilePath also triggers that initial, unwanted message:

if (logLevel != null || logFilePath) {
Logger.getInstance().info('Configuring logger with level: %s, filePath: %s, additionalLogToConsole: %s', logLevel, logFilePath, additionalLogToConsole);

Activity

  1. changed the title [-]Disabling logging without anything being logged to stdout is difficult[/-] [+]SNOW-1800528: Disabling logging without anything being logged to stdout is difficult[/+] on Nov 12, 2024
  2. sfc-gh-dszmolka commented on Nov 13, 2024

    @sfc-gh-dszmolka
    Collaborator

    hi - you're right, that's not how OFF loglevel intended to work. we'll take a look.

  3. added
    status-triage_doneInitial triage done, will be further handled by the driver team
    and removed
    status-triageIssue is under initial triage
    on Nov 13, 2024
  4. sfc-gh-dszmolka commented on Nov 13, 2024

    @sfc-gh-dszmolka
    Collaborator

    PR #958 edit: merged, will be part of the next upcoming release cycle

  5. added
    status-fixed_awaiting_releaseThe issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector.
    and removed on Nov 13, 2024
  6. velocityzen commented on Dec 2, 2024

    @velocityzen

    When is this going to be released? This is critical bug as it makes the whole STDOUT unusable.

  7. sfc-gh-dszmolka commented on Dec 3, 2024

    @sfc-gh-dszmolka
    Collaborator

    thank you for bearing with us while this is getting released! Currently, since we also need to consider other things which will be included in the release, there's unfortunately no more precise estimation for the release date than we hoping to be able to do it this week.

    Until the release is actually out, if this is a critical issue for you, as a mitigation you can try:

    • git clone this repo
    • npm install from master branch
    • requireing the directory which has the master branch installed, instead of snowflake-sdk
      which master branch already has the fix.
  8. visnup commented on Dec 6, 2024

    @visnup
    Author

    @velocityzen I also included a workaround above which is non-obvious but works for me for now.

  9. sfc-gh-dszmolka commented on Dec 11, 2024

    @sfc-gh-dszmolka
    Collaborator

    released with Snowflake Node.js driver v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingstatus-fixed_awaiting_releaseThe issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector.status-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions