Document log rotation directives
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 23 Dec 2022 15:20:34 +0000 (16:20 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 23 Dec 2022 15:20:34 +0000 (16:20 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
README.md
src/assets/config-template.json
src/utils/Logger.ts

index 637f20da0494dc5c33baa3c19569386ee12d0c76..39e45b1023618307d8b294ce8f8cc2baae8e4329 100644 (file)
--- 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
index 9ad01aa1acc89c8cfa4e7f660d6f24454af2ee72..e1620aa7c899a071171eda539565f679ddb701b2 100644 (file)
@@ -44,6 +44,7 @@
     }
   ],
   "logStatisticsInterval": 0,
+  "logMaxFiles": 7,
   "logFile": "combined.log",
   "logErrorFile": "error.log"
 }
index 61e4b0bc24dd1e4887b7fc6c91a69c87d010a7e1..c3ea5c5c95defc83622e5571186193c025e02b15 100644 (file)
@@ -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 = [