This commit is contained in:
David Arranz 2024-09-08 22:05:26 +02:00
parent 904e30ebf8
commit 32e7599666
2 changed files with 5 additions and 3 deletions

View File

@ -28,6 +28,8 @@ services:
dockerfile: Dockerfile.server
environment:
- NODE_ENV=production
volumes:
- backend_logs:/logs
ports:
- 3001:3001
networks:

View File

@ -42,13 +42,13 @@ function initLogger(rTracer) {
);
const logger = createLogger({
level: process.env.NODE_ENV === "production" ? "debug" : "debug",
level: config.isProduction ? "debug" : "debug",
format: fileFormat,
transports: [
new DailyRotateFile({
dirname: "./log",
dirname: config.isProduction ? "/logs" : ".",
filename: "error-%DATE%.log",
datePattern: "YYYY-MM-DD",
utc: true,
@ -57,7 +57,7 @@ function initLogger(rTracer) {
maxFiles: "1d",
}),
new DailyRotateFile({
dirname: "./log",
dirname: config.isProduction ? "/logs" : ".",
filename: "debug-%DATE%.log",
datePattern: "YYYY-MM-DD",
utc: true,