From: Jérôme Benoit Date: Fri, 23 Dec 2022 15:20:34 +0000 (+0100) Subject: Document log rotation directives X-Git-Tag: v1.1.89~61 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d42ee3c9721648623f231466c26a35be678fc25e;p=e-mobility-charging-stations-simulator.git Document log rotation directives Signed-off-by: Jérôme Benoit --- diff --git a/README.md b/README.md index 637f20da..39e45b10 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,8 @@ But the modifications to test have to be done to the files in the build target d | logConsole | true/false | false | boolean | output logs on the console | | logFormat | | simple | string | winston log format | | logRotate | true/false | true | boolean | enable daily log files rotation | -| logMaxFiles | | 7 | integer | maximum number of log files to keep | +| logMaxFiles | x, "xd" where x is an integer | undefined | integer \| string | maximum number of log files | +| logMaxSize | x, "xk", "xm", "xg" where x is a number | undefined | number \| string | maximum size of log files in bytes, or units of kB, mB, and gB | | logLevel | emerg/alert/crit/error/warning/notice/info/debug | info | string | winston logging level | | logFile | | combined.log | string | log file relative path | | logErrorFile | | error.log | string | error log file relative path | diff --git a/src/assets/config-template.json b/src/assets/config-template.json index 9ad01aa1..e1620aa7 100644 --- a/src/assets/config-template.json +++ b/src/assets/config-template.json @@ -44,6 +44,7 @@ } ], "logStatisticsInterval": 0, + "logMaxFiles": 7, "logFile": "combined.log", "logErrorFile": "error.log" } diff --git a/src/utils/Logger.ts b/src/utils/Logger.ts index 61e4b0bc..c3ea5c5c 100644 --- a/src/utils/Logger.ts +++ b/src/utils/Logger.ts @@ -7,7 +7,7 @@ import Configuration from './Configuration'; import Utils from './Utils'; let transports: transport[]; -if (Configuration.getLogRotate()) { +if (Configuration.getLogRotate() === true) { const logMaxFiles = Configuration.getLogMaxFiles(); const logMaxSize = Configuration.getLogMaxSize(); transports = [