CyberSource / CyberSource/cybersource-rest-client-node

enableLog flag not working

Open
#66 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
49
Forks
50
Avg merge
18m
Merged PRs (30d)
2

Description

Summary

The enableLog configuration option is disregarded and log files are generated even when the value is false.

Expected Behavior

Specifying enableLog: false when creating a new API client should suppress log files from being written to. An example would be as follows:

const cybersourceRestApi = require('cybersource-rest-client')
const merchantConfig = {
  authenticationType: 'http_signature',
  runEnvironment: 'cybersource.environment.SANDBOX',
  merchantID: 'XXXXXXX',
  merchantKeyId: 'XXXXXXXXX',
  merchantsecretKey: 'XXXXXXXXXXXXXX',
  enableLog: false // this should result in logs from the CyberSource REST client being suppressed
}

const paymentsApi = new cybersourceRestApi.PaymentsApi(merchantConfig)
Actual Behavior

When enableLog: false is specified, the CyberSource REST client still writes logs to the filesystem.

Other Comments

It looks like there was a switch to using the winston-daily-rotate-file package recently, and the enableLog option from the CyberSource client is being passed to this transport as part of a silent option. However, it looks like there is no reference to a silent option in the documentation for this package and so it may not be a valid option for this transport.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how enableLog is passed from the new API client configuration into the winston-daily-rotate-file transport, focusing on the transport's silent option. Confirm whether that option suppresses filesystem logging, then verify that enableLog: false prevents log files while the default or enabled setting still writes them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.