skyeye-svc-common-utils 2.0.0-dev0.32 → 2.0.0-dev0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.morganConsole = exports.morganFile = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const morgan_1 = __importDefault(require("morgan"));
|
|
9
|
-
const rotating_file_stream_1 =
|
|
9
|
+
const rotating_file_stream_1 = require("rotating-file-stream");
|
|
10
10
|
const appConfig_1 = require("../appConfig");
|
|
11
11
|
const dateformat_1 = __importDefault(require("dateformat"));
|
|
12
12
|
// ensure log directory exists
|
|
@@ -19,7 +19,7 @@ const FileNameGenerator = (time, index) => {
|
|
|
19
19
|
return `backend-access-${(0, dateformat_1.default)(time, 'yyyy-mm-dd')}${indexStr}.log`;
|
|
20
20
|
};
|
|
21
21
|
// create a rotating write stream
|
|
22
|
-
const accessLogStream = rotating_file_stream_1.
|
|
22
|
+
const accessLogStream = (0, rotating_file_stream_1.createStream)(FileNameGenerator, {
|
|
23
23
|
interval: '1d',
|
|
24
24
|
path: appConfig_1.commonAppConfig.LogPath
|
|
25
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morganLogger.js","sourceRoot":"","sources":["../../../src/utils/logger/morganLogger.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,oDAA4B;AAC5B
|
|
1
|
+
{"version":3,"file":"morganLogger.js","sourceRoot":"","sources":["../../../src/utils/logger/morganLogger.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,oDAA4B;AAC5B,+DAAoD;AACpD,4CAA+C;AAC/C,4DAAoC;AAEpC,8BAA8B;AAC9B,YAAE,CAAC,UAAU,CAAC,2BAAe,CAAC,OAAO,CAAC,IAAI,YAAE,CAAC,SAAS,CAAC,2BAAe,CAAC,OAAO,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AAC,CAAA;AACR,CAAC,CAAA;AAED,mBAAmB;AACN,QAAA,UAAU,GAAG,IAAA,gBAAM,EAAC,UAAU,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;AAE7D,QAAA,aAAa,GAAI,IAAA,gBAAM,EAAC,UAAU,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import morgan from 'morgan';
|
|
3
|
-
import
|
|
3
|
+
import { createStream } from 'rotating-file-stream';
|
|
4
4
|
import { commonAppConfig } from '../appConfig';
|
|
5
5
|
import dateformat from 'dateformat';
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ const FileNameGenerator = (time: number | Date, index: number) => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// create a rotating write stream
|
|
20
|
-
const accessLogStream =
|
|
20
|
+
const accessLogStream = createStream(FileNameGenerator, {
|
|
21
21
|
interval: '1d', // rotate daily
|
|
22
22
|
path: commonAppConfig.LogPath
|
|
23
23
|
});
|