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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now