Skip to content

SNOW-1974382: Logger is still making its dirty outputs to stdout #1026

Closed

Description

@velocityzen

If you need urgent assistance then file a case with Snowflake Support.
Otherwise continue here.

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?
    2.0.2

  2. What operating system and processor architecture are you using?
    macos 15.3.1 / m3max

  3. What version of NodeJS are you using?
    (node --version and npm --version)
    22.14.0

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

  5. What did you do?

this worked well before upgrading to 2x version

snowflake.configure({
  logLevel: "OFF",
  additionalLogToConsole: false,
});

  1. What did you expect to see?

nothing
What should have happened and what happened instead?

{"level":"INFO","message":"[11:14:45.594 AM]: Configuring logger with level: -1, filePath: undefined, additionalLogToConsole: undefined"}

it outputs this, and then keeps it quite.

Can you please stop using stdout for logging? Logging should be done to stderr

Activity

  1. changed the title [-]Logger is still making its dirty outputs to stdout[/-] [+]SNOW-1974382: Logger is still making its dirty outputs to stdout[/+] on Mar 10, 2025
  2. velocityzen commented on Mar 10, 2025

    @velocityzen
    Author

    there is a mistake in your docs as well:
    Image

    configure function supposed to be called.

  3. sfc-gh-dszmolka commented on Mar 11, 2025

    @sfc-gh-dszmolka
    Collaborator

    hi - this was indeed an issue with #957, but it's been fixed with 2.0.0

    i did a quick test with nothing else but snowflake.configure({ logLevel: "OFF" });

    # npm i [email protected] > /dev/null 2>&1 && node test.js && npm i [email protected] > /dev/null 2>&1 && node test.js
    {"level":"INFO","message":"[8:31:54.355 AM]: Configuring logger with level: -1, filePath: undefined, additionalLogToConsole: undefined"} # 1.15.0
    [2025-03-11T08:31:56.375Z] { 'CURRENT_VERSION()': '9.5.2' } # 1.15.0
    [2025-03-11T08:32:06.440Z] { 'CURRENT_VERSION()': '9.5.2' } # 2.0.0
    

    with v2 nothing is output.
    Can you please try, if it works for you too?

    The documentation remark is on point though, we need to fix that, i'll work with my Docs team on that.

  4. added
    questionIssue is a usage/other question rather than a bug
    status-triage_doneInitial triage done, will be further handled by the driver team
    status-pending_closureIf no further assistance is needed, let's close the issue out.
    and removed
    bugSomething isn't working
    on Mar 11, 2025
  5. velocityzen commented on Mar 11, 2025

    @velocityzen
    Author

    I tried with just snowflake.configure({ logLevel: "OFF" }); and it didn't change anything.

    We use TypeScript maybe it has something do with it?

  6. sfc-gh-dszmolka commented on Mar 11, 2025

    @sfc-gh-dszmolka
    Collaborator

    same for me with TypeScript:

    # npm i [email protected] > /dev/null 2>&1 && npx tsx tstest.ts && npm i [email protected] > /dev/null 2>&1 && npx tsx tstest.ts
    {"level":"INFO","message":"[3:20:05.252 PM]: Configuring logger with level: -1, filePath: undefined, additionalLogToConsole: undefined"}
    [2025-03-11T15:20:06.999Z] { 'CURRENT_VERSION()': '9.5.2' }
    [2025-03-11T15:20:12.035Z] { 'CURRENT_VERSION()': '9.5.2' }
    

    my repro:

    import * as snowflake from 'snowflake-sdk';
    import 'log-timestamp';
    
    snowflake.configure({ logLevel: "OFF" });
    
    const connection = snowflake.createConnection({
        account: process.env.SFACCOUNT as string,
        username: process.env.SFUSER as string,
        password: process.env.SFPASS as string,
        application: __filename.slice(__dirname.length + 1)
    });
    
    connection.connect((err, conn) => {
        if (err) {
            console.error('Unable to connect: ' + err.message);
            return;
        }
    
        const statement = connection.execute({
            sqlText: "select current_version();",
            complete: (err: snowflake.SnowflakeError | undefined, stmt: snowflake.RowStatement, rows: any[] | undefined ) => {
    	    if (err) {
                    console.error('Failed to execute statement due to the following error: ' + err.message);
                    return;
                }
    
                if (rows && rows.length > 0) { 
                    for (const row of rows) {
                        console.log(row);
                    }
                } else {
                    console.log('No rows returned.');
                }
            }
        });
    });

    can you please send me a runnable piece of code, which when run on my end, reproduces the issue on v2+ ?

  7. velocityzen commented on Mar 11, 2025

    @velocityzen
    Author

    let me try to make an example
    the difference I noticed is that we use createPool and not createConnection

  8. velocityzen commented on Mar 17, 2025

    @velocityzen
    Author

    It disappeared after updating to 2.0.3 version

  9. sfc-gh-dszmolka commented on Mar 17, 2025

    @sfc-gh-dszmolka
    Collaborator

    Thank you - marking this one as closed for now; but if you require further help please do comment and i can reopen.

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

Metadata

Metadata

Labels

questionIssue is a usage/other question rather than a bugstatus-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