diff --git a/config.yml.example b/config.yml.example index 127cbb6..463ddd8 100644 --- a/config.yml.example +++ b/config.yml.example @@ -238,7 +238,6 @@ persistStatus: true logging: directory: logs logRotatePattern: YYYY-MM-DD - backlogSize: 1000 #Advanced option, read the doc maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: false diff --git a/docs/configuration.md b/docs/configuration.md index 0f95d35..7491322 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -31,7 +31,6 @@ The following are advanced parameters, please don't touch them if you are not do |environment| You can specify various environments. The values "production" (not verbose) and "development" (verbose) will affect the verbosity of the error/debug logs. The value "research" is explained [here](research.md). Other values don't affect the functionalities, they will be used to identify from which environment the log is coming from. | A string | production | Yes | |alertOnlyOnce| A boolean that, if set to true, will prevent repetitions of the same alert in the future (which it doesn't make sense for production purposes). In this case notificationIntervalSeconds will be ignored. If set to true, the signature of all alerts will be cached in order to recognize if they already happened in the past. This may lead to a memory leak if the amount of alerts is considerable. | A boolean | false | No | |pidFile| A file where the PID of the BGP alerter master process is recorded. | A string | bgpalerter.pid | No | -|logging.backlogSize| Indicates the buffer dimension (number of alerts) before flushing it on the disk. This parameter plays a role only when receiving thousand of alerts per second in order to prevent IO starvation, in all other cases (e.g. production monitoring) it is irrelevant. | An integer | 15 | Yes | |maxMessagesPerSecond| A cap to the BGP messages received, over such cap the messages will be dropped. The default value is way above any production rate. Changing this value may be useful only for research measurements on the entire address space. | An integer | 6000 | No | |multiProcess| If set to true, the processing of the BGP messages will be distributed on two processes. This may be useful for research measurements on the entire address space. It is discouraged to set this to true for normal production monitoring. | A boolean | false | No | |fadeOffSeconds| If an alert is generated but cannot be yet squashed (e.g. not reached yet the `thresholdMinPeers`), it is inserted in a temporary list which is garbage collected after the amount of seconds expressed in `fadeOffSeconds`. Due to BGP propagation times, values below 5 minutes can result in false negatives.| An integer | 360 | No | diff --git a/src/env.js b/src/env.js index 25f8831..5f6d213 100644 --- a/src/env.js +++ b/src/env.js @@ -136,7 +136,6 @@ let config = { logging: { directory: "logs", logRotatePattern: "YYYY-MM-DD", - backlogSize: 1000, maxRetainedFiles: 10, maxFileSizeMB: 15, compressOnRotation: false, @@ -213,7 +212,6 @@ const errorTransport = new FileLogger({ filename: 'error-%DATE%.log', symLink: 'error.log', directory: config.volume + config.logging.directory, - backlogSize: config.logging.backlogSize, maxRetainedFiles: config.logging.maxRetainedFiles, maxFileSizeMB: config.logging.maxFileSizeMB, compressOnRotation: config.logging.compressOnRotation, @@ -227,7 +225,6 @@ const verboseTransport = new FileLogger({ filename: 'reports-%DATE%.log', symLink: 'reports.log', directory: config.volume + config.logging.directory, - backlogSize: config.logging.backlogSize, maxRetainedFiles: config.logging.maxRetainedFiles, maxFileSizeMB: config.logging.maxFileSizeMB, compressOnRotation: config.logging.compressOnRotation, diff --git a/src/utils/fileLogger.js b/src/utils/fileLogger.js index ff2e10f..0a83362 100644 --- a/src/utils/fileLogger.js +++ b/src/utils/fileLogger.js @@ -9,6 +9,7 @@ export default class FileLogger { this.format = params.format || this.defaultFormat; this.logRotatePattern = params.logRotatePattern || "YYYY-MM-DD"; this.filename = params.filename; + this.symLinkName = params.symLink; this.useUTC = params.useUTC; this.directory = params.directory; this.levels = params.levels || ['error', 'info', 'verbose']; @@ -18,8 +19,6 @@ export default class FileLogger { this.maxFileSizeMB = parseFloat(params.maxFileSizeMB || 20); this.maxRetainedFiles = parseFloat(params.maxRetainedFiles || 20); - this.backlogSize = parseFloat(params.backlogSize || 100); - if (!fs.existsSync(this.directory)){ fs.mkdirSync(this.directory); } @@ -28,9 +27,12 @@ export default class FileLogger { filename: `${this.directory}/${this.filename}`, size: `${this.maxFileSizeMB}m`, frequency: "custom", + end_stream: true, max_logs: this.maxRetainedFiles, date_format: this.logRotatePattern, utc: this.useUTC, + create_symlink: true, + symlink_name: this.symLinkName, verbose: false }; diff --git a/tests/config.test.yml b/tests/config.test.yml index a02aae5..20a8e68 100644 --- a/tests/config.test.yml +++ b/tests/config.test.yml @@ -70,7 +70,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/generate_tests/config.test.yml b/tests/generate_tests/config.test.yml index c48ad14..2268dcc 100644 --- a/tests/generate_tests/config.test.yml +++ b/tests/generate_tests/config.test.yml @@ -67,7 +67,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/kafka_tests/config.kafka.test.yml b/tests/kafka_tests/config.kafka.test.yml index d409f67..1f7bc7b 100644 --- a/tests/kafka_tests/config.kafka.test.yml +++ b/tests/kafka_tests/config.kafka.test.yml @@ -68,7 +68,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/proxy_tests/config.proxy.test.yml b/tests/proxy_tests/config.proxy.test.yml index b1c5db8..2e4c27c 100644 --- a/tests/proxy_tests/config.proxy.test.yml +++ b/tests/proxy_tests/config.proxy.test.yml @@ -41,7 +41,6 @@ processMonitors: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/reports_tests/config.kafka.test.yml b/tests/reports_tests/config.kafka.test.yml index 18e1595..7ae7ad2 100644 --- a/tests/reports_tests/config.kafka.test.yml +++ b/tests/reports_tests/config.kafka.test.yml @@ -229,7 +229,6 @@ persistStatus: true logging: directory: logs logRotatePattern: YYYY-MM-DD - backlogSize: 1000 #Advanced option, read the doc maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: false diff --git a/tests/reports_tests/config.reports.test.yml b/tests/reports_tests/config.reports.test.yml index a6c05c7..c82c8f6 100644 --- a/tests/reports_tests/config.reports.test.yml +++ b/tests/reports_tests/config.reports.test.yml @@ -91,7 +91,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/rpki_tests/config.rpki.test.default.yml b/tests/rpki_tests/config.rpki.test.default.yml index 90b4b0c..38ad34e 100644 --- a/tests/rpki_tests/config.rpki.test.default.yml +++ b/tests/rpki_tests/config.rpki.test.default.yml @@ -24,7 +24,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/rpki_tests/config.rpki.test.external-roas.yml b/tests/rpki_tests/config.rpki.test.external-roas.yml index ed86889..9a428e7 100644 --- a/tests/rpki_tests/config.rpki.test.external-roas.yml +++ b/tests/rpki_tests/config.rpki.test.external-roas.yml @@ -20,7 +20,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true diff --git a/tests/rpki_tests/config.rpki.test.external.yml b/tests/rpki_tests/config.rpki.test.external.yml index 4304bef..64dbc06 100644 --- a/tests/rpki_tests/config.rpki.test.external.yml +++ b/tests/rpki_tests/config.rpki.test.external.yml @@ -24,7 +24,6 @@ monitoredPrefixesFiles: logging: directory: logs logRotatePattern: YYYY-MM-DD # Whenever the pattern changes, a new file is created and the old one rotated - backlogSize: 1 maxRetainedFiles: 10 maxFileSizeMB: 15 compressOnRotation: true