gleason Posted March 31, 2021 Posted March 31, 2021 Has anyone had any success logging node.js console.log to a file? Was reading some other post about having to use home/username/logfile but coming up short I did try home/mule/debug.log as well just for information const fs = require('fs');var util = require('util');var log_file = fs.createWriteStream(__dirname + 'home/mule/node/debug.log', {flags : 'w'});var log_stdout = process.stdout;console.log = function(d) { // log_file.write(util.format(d) + '\n'); log_stdout.write(util.format(d) + '\n');}; attempting to use this information to troubleshoot my code. potentially better idea to modify start.py to log errors but no clue how to go about doing that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.