We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aab5c08 commit ea3531dCopy full SHA for ea3531d
api/src/utils/custom-logger.utils.ts
@@ -48,9 +48,10 @@ const customLogger = async (
48
if (!fs.existsSync(logFilePath)) {
49
// If the file does not exist, create it and write an initial log entry
50
console.info(`Creating new log file at: ${logFilePath}`);
51
- // Add stack trace to debug where this is being called from
52
- console.info(new Error().stack);
53
-
+ // Conditionally log stack trace based on environment
+ if (process.env.NODE_ENV !== 'production') {
+ console.info(new Error().stack);
54
+ }
55
await fs.promises.writeFile(logFilePath, 'Log file created\n', {
56
flag: 'a',
57
});
0 commit comments