diff --git a/LICENSE.md b/LICENSE.md index 90fff8b..cdcc7fd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Chris Troutner +Copyright (c) 2021 Permissionless Software Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/util/winston-logging.js b/src/util/winston-logging.js index fd66813..1843713 100644 --- a/src/util/winston-logging.js +++ b/src/util/winston-logging.js @@ -11,13 +11,19 @@ require('winston-daily-rotate-file') var NETWORK = process.env.NETWORK +// Default 1 Megabyte +var LOG_MAX_SIZE = process.env.LOG_MAX_SIZE ? process.env.LOG_MAX_SIZE : '1m' + +// Default 5 days. +var LOG_MAX_FILES = process.env.LOG_MAX_FILES ? process.env.LOG_MAX_FILES : '5d' + // Configure daily-rotation transport. var transport = new winston.transports.DailyRotateFile({ filename: `${__dirname}/../../logs/rest-${NETWORK}-%DATE%.log`, datePattern: 'YYYY-MM-DD', zippedArchive: false, - maxSize: '1m', - maxFiles: '5d', + maxSize: LOG_MAX_SIZE, + maxFiles: LOG_MAX_FILES, format: winston.format.combine( winston.format.timestamp(), winston.format.json() diff --git a/start-dev-example.sh b/start-dev-example.sh index c9bbcea..650b793 100755 --- a/start-dev-example.sh +++ b/start-dev-example.sh @@ -54,4 +54,10 @@ export ANON_RATE_LIMIT=50 # 10 = 100 RPM export WHITELIST_RATE_LIMIT=10 +# Set logging parameters +#1m means no more than 1 megabyte +export LOG_MAX_SIZE=1m +#5d means store no more than 5 days +export LOG_MAX_FILES=5d + npm start