Repository navigation
Description
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
-
What version of NodeJS driver are you using?
1.15.0 -
What operating system and processor architecture are you using?
darwin arm64 -
What version of NodeJS are you using?
v20.18.0 -
What are the component versions in the environment (
npm list)?
N/A -
What did you do?
snowflake.configure({logLevel: "OFF"});- 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:
snowflake-connector-nodejs/lib/core.js
Lines 189 to 190 in d50e1ce
| if (logLevel != null || logFilePath) { | |
| Logger.getInstance().info('Configuring logger with level: %s, filePath: %s, additionalLogToConsole: %s', logLevel, logFilePath, additionalLogToConsole); |
Activity
[-]Disabling logging without anything being logged to stdout is difficult[/-][+]SNOW-1800528: Disabling logging without anything being logged to stdout is difficult[/+]sfc-gh-dszmolka commentedon Nov 13, 2024
hi - you're right, that's not how
OFFloglevel intended to work. we'll take a look.sfc-gh-dszmolka commentedon Nov 13, 2024
PR #958 edit: merged, will be part of the next upcoming release cycle
velocityzen commentedon Dec 2, 2024
When is this going to be released? This is critical bug as it makes the whole STDOUT unusable.
sfc-gh-dszmolka commentedon Dec 3, 2024
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 clonethis reponpm installfrommasterbranchrequireing the directory which has themasterbranch installed, instead ofsnowflake-sdkwhich
masterbranch already has the fix.visnup commentedon Dec 6, 2024
@velocityzen I also included a workaround above which is non-obvious but works for me for now.
sfc-gh-dszmolka commentedon Dec 11, 2024
released with Snowflake Node.js driver v2.0.0
fix: bump `snowflake-sdk` to `^2.0.3` to fully resolve stdout log noise
fix: suppress Snowflake SDK stdout log noise in TUI (#305)