mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Write homepage.log into config folder
This will make it easier for people to find their log file(s)
This commit is contained in:
parent
666e2a42cf
commit
5776544c20
@ -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
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user