Merge pull request #246 from JazzFisch/fix-log-folder

Write homepage.log into config folder
This commit is contained in:
Jason Fischer
2022-09-21 08:46:21 -07:00
committed by GitHub

View File

@@ -1,5 +1,9 @@
import { join } from "path";
import winston from "winston";
const configPath = join(process.cwd(), "config");
function messageFormatter(logInfo) {
if (logInfo.stack) {
return `[${logInfo.timestamp}] ${logInfo.level}: ${logInfo.stack}`;
@@ -33,7 +37,7 @@ const logger = winston.createLogger({
new winston.transports.File({
format: fileFormat,
filename: 'homepage.log',
filename: `${configPath}/logs/homepage.log`,
handleExceptions: true,
handleRejections: true
}),