Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Outcome of this SPIKE
@W-10745422@
Implements the rotating log stream supported in Bunyan into sfdx-core's logger
Testing instructions
yarn link
cd
to localsfdx-cli
yarn link @salesforce/core
SFDX_LOG_ROTATION_PERIOD='5000ms' ./bin/run force:org:list --loglevel=trace
./bin/run
sfdx.log
,sfdx.log.0
,sfdx.log.1
,sfdx.log.2
)tail -f sfdx.log
Worth noting
sfdx.log
and run commands until is is removed.mkfile 30g ./sfdx.log
time bin/run force:org:list
typically took about 5 seconds to run but when my30gb
was cleared it took close to 15 seconds.ms
interval does not behave exactly like the other intervals. Hourly, Daily, Weekly, etc will "switch" log files at the start of a new period (e.g. daily happens at midnight). Docs on "period" here. Milliseconds will rotate logs on each command regardless. This can be tested a little more accurately by modifying Bunyan's code slightly.core
directory (sfdx-cli/node_modules/@salesforce/core/node_modules/@salesforce/bunyan/lib/bunyan.js
) change:switch
statement on line1314
:min
intervals and the logs will rotate at the start of each new minuteSFDX_LOG_ROTATION_PERIOD='1min' ./bin/run force:org:list --loglevel=trace