mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-24 04:34:55 +02:00
use config file instead of env
This commit is contained in:
parent
6fb569e2cd
commit
d9ae322e2a
19 changed files with 189 additions and 209 deletions
|
@ -1,5 +1,5 @@
|
|||
import "winston-daily-rotate-file";
|
||||
import environment from "@server/environment";
|
||||
import config, { APP_PATH } from "@server/config";
|
||||
import * as winston from "winston";
|
||||
import path from "path";
|
||||
|
||||
|
@ -24,11 +24,11 @@ const transports: any = [
|
|||
}),
|
||||
];
|
||||
|
||||
if (environment.SAVE_LOGS) {
|
||||
if (config.app.save_logs) {
|
||||
transports.push(
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: path.join(
|
||||
environment.CONFIG_PATH,
|
||||
APP_PATH,
|
||||
"logs",
|
||||
"pangolin-%DATE%.log",
|
||||
),
|
||||
|
@ -43,7 +43,7 @@ if (environment.SAVE_LOGS) {
|
|||
transports.push(
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: path.join(
|
||||
environment.CONFIG_PATH,
|
||||
APP_PATH,
|
||||
"logs",
|
||||
".machinelogs-%DATE%.json",
|
||||
),
|
||||
|
@ -63,7 +63,7 @@ if (environment.SAVE_LOGS) {
|
|||
}
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: environment.LOG_LEVEL.toLowerCase(),
|
||||
level: config.app.log_level.toLowerCase(),
|
||||
format: winston.format.combine(
|
||||
winston.format.splat(),
|
||||
winston.format.timestamp(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue