I have a case wherein I need to capture the logs generated by Newman CLI reporter under newman.run() function inside the Nodejs code and use it for later. There is no such option under reporter to capture the logs inside a file or a stream. Any suggestions for the same?
newman.run({
collection: file.json,
reporters : ['cli'],
},function (err, summary) {
if (err) {
console.log(err);
});
I need access to the logs inside the callback function.

The
consoleevent can capture the logsDemo
REST API to get
categorywith console.log() inTeststab.In
TestsTabFull collection for two APIs.
Export as
1-log-demo.postman_collection.jsondemo code
get-console.jsInstall Dependency
Run it
Result
Compare Between
newmanvsget-console.jsnewman(left) vsget-console.js(right)