Skip to content

feat(winston): added option to capture info logs#2662

Open
aryamohanan wants to merge 4 commits into
mainfrom
feat-winston
Open

feat(winston): added option to capture info logs#2662
aryamohanan wants to merge 4 commits into
mainfrom
feat-winston

Conversation

@aryamohanan

@aryamohanan aryamohanan commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for capturing info-level logs for Winston. By default, log capture starts at WARN and above. When configured, INFO logs can also be captured.

Reference: https://github.com/winstonjs/winston#logging-levels

Configuration

The log capture level can be configured using either:

  • Environment variable: INSTANA_LOG_LEVEL_CAPTURE
  • In-code configuration: tracing.logLevelCapture

Supported values:

  • INFO
  • WARN (default)
  • ERROR
  • OFF

Log capture behavior

Configuration Captured log levels
INFO INFO, WARN, ERROR, FATAL
WARN WARN, ERROR, FATAL
ERROR ERROR, FATAL
OFF No log spans are captured.

ref: https://jsw.ibm.com/browse/INSTA-101942
tech spec: https://github.ibm.com/instana/technical-documentation/blob/master/tracing/specification/README.md#log-spans

silly: LOG_LEVEL.TRACE,

// RFC 5424 syslog levels
emerg: LOG_LEVEL.FATAL,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aryamohanan
aryamohanan marked this pull request as ready for review July 17, 2026 05:54
@aryamohanan
aryamohanan requested a review from a team as a code owner July 17, 2026 05:54
Comment thread packages/core/src/tracing/instrumentation/logging/winston.js Outdated
Comment thread packages/core/src/tracing/instrumentation/logging/winston.js Outdated

function levelIsError(level) {
return level === 'error' || level === 'emerg' || level === 'alert' || level === 'crit';
const resolvedLevel = resolveLogLevel(level);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we call this fn in three places and worst case we call it 3x.

We can remember it:

const normalizedLogLevel = resolveLogLevel(level):

// use it normalizedLogLevel

@kirrg001 kirrg001 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants