Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: setLogger not work with winstonLogger #1521

Closed
andreseloysv opened this issue Jan 17, 2025 · 2 comments
Closed

[Bug]: setLogger not work with winstonLogger #1521

andreseloysv opened this issue Jan 17, 2025 · 2 comments
Assignees
Labels

Comments

@andreseloysv
Copy link

andreseloysv commented Jan 17, 2025

Problem Description

Issue Description:

Calling instana.setLogger(this.winstonLogger) throws the following error, which started occurring after the release of version 4.5.1. The error is triggered due to the introduction of parentLogger.bindings().

Error Details:

UnhandledPromiseRejectionWarning: TypeError: parentLogger.bindings is not a function
    at Object.init (/usr/local/lib/node_modules/@instana/collector/src/logger.js:76:28)
    at Function.setLogger (/usr/local/lib/node_modules/@instana/collector/src/index.js:145:7)
    at new TaloLoggerImpl2 (/app/node_modules/@omniweb/talo-logging/build/talo-logging.cjs:313:17)

Steps to Reproduce:

  1. Call instana.setLogger(this.winstonLogger) after upgrading to version 4.5.1.
  2. Observe the error in the logs.

Expected Behavior:

The logger should be set without any errors, similar to how it worked in previous versions.

Environment:

  • Node.js version: 22.13.0
  • Instana Collector version: 4.5.1
  • WinstonLogger: 3.16.0

Short, Self Contained Example

No response

Node.js Version

22.13.0

package.json

{
  "type": "module",
  "keywords": [
    "winston",
    "logger"
  ],
  "dependencies": {
    "@swc/helpers": "0.5.15",
    "logform": "2.6.1",
    "winston": "3.16.0",
    "winston-transport": "4.9.0"
  },
  "devDependencies": {
    "@types/jest": "29.5.14",
    "@types/node": "22.10.5",
    "jest": "29.7.0",
    "ts-jest": "29.2.5",
    "typescript": "5.6.3"
  },
  "peerDependencies": {
    "@instana/collector": "*"
  },
  "peerDependenciesMeta": {
    "@instana/collector": {
      "optional": true
    }
  }
}

package-lock.json

{
  "type": "module",
  "keywords": [
    "winston",
    "logger"
  ],
  "dependencies": {
    "@swc/helpers": "0.5.15",
    "logform": "2.6.1",
    "winston": "3.16.0",
    "winston-transport": "4.9.0"
  },
  "devDependencies": {
    "@types/jest": "29.5.14",
    "@types/node": "22.10.5",
    "jest": "29.7.0",
    "ts-jest": "29.2.5",
    "typescript": "5.6.3"
  },
  "peerDependencies": {
    "@instana/collector": "*"
  },
  "peerDependenciesMeta": {
    "@instana/collector": {
      "optional": true
    }
  }
}
@aryamohanan
Copy link
Contributor

@andreseloysv Thank you for your report! We'll take a look as soon as possible. In the meantime, please use version v4.5.0 as a workaround.

@kirrg001
Copy link
Contributor

@andreseloysv

Released v4.6.0.

If the bug is not resolved, please re-open this issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants