I need to use my node application in production using the root user in a linux-based server. This server is shared with other teams and I don't want them to get console logs printed in their face.
Even though I have no console.log() in my code, I'm using express, specifically this body parser to parse JSON requests:
// Body Parser Middleware
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
And if a user sends a JSON object with syntax error, it will get printed in the console. How can I prevent this?
And if there is a way to just prevent node.js from ever printting on the console, not just in that specific case but ever, that would be even better. Or output all console log attempts into a .txt file instead of the console that would be even better.