skyeye-svc-common-utils 2.0.0-dev0.33 → 2.0.0-dev0.35
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.
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
export declare const morganFile: (req: IncomingMessage, res: ServerResponse<IncomingMessage>, callback: (err?: Error) => void) => void;
|
|
4
|
+
export declare const morganConsole: (req: IncomingMessage, res: ServerResponse<IncomingMessage>, callback: (err?: Error) => void) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morganLogger.js","sourceRoot":"","sources":["../../../src/utils/logger/morganLogger.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,
|
|
1
|
+
{"version":3,"file":"morganLogger.js","sourceRoot":"","sources":["../../../src/utils/logger/morganLogger.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,oDAA8C;AAC9C,+DAAoD;AACpD,4CAA+C;AAC/C,4DAAoC;AAGpC,8BAA8B;AAC9B,YAAE,CAAC,UAAU,CAAC,2BAAe,CAAC,OAAO,CAAC,IAAI,YAAE,CAAC,SAAS,CAAC,2BAAe,CAAC,OAAO,CAAC,CAAC;AAEhF,MAAM,iBAAiB,GAAG,CAAC,IAAmB,EAAE,KAAa,EAAE,EAAE;IAC7D,IAAI,CAAC,IAAI,EAAE;QACP,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;KACrB;IAED,MAAM,QAAQ,GAAa,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC,CAAC,EAAE,CAAC;IACrE,OAAO,kBAAkB,IAAA,oBAAU,EAAC,IAAI,EAAC,YAAY,CAAC,GAAG,QAAQ,MAAM,CAAC;AAC5E,CAAC,CAAA;AA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
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@azure/storage-queue": "^12.0.2",
|
|
29
29
|
"@azure/search-documents": "11.2.1",
|
|
30
30
|
"@azure/abort-controller": "1.0.4",
|
|
31
|
-
"@sendgrid/mail": "^
|
|
31
|
+
"@sendgrid/mail": "^8.1.1",
|
|
32
32
|
"async-mutex": "^0.3.2",
|
|
33
33
|
"cron-parser": "4.8.1",
|
|
34
34
|
"dateformat": "^4.6.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"node-fetch": "^2.6.0",
|
|
45
45
|
"rotating-file-stream": "^3.2.1",
|
|
46
46
|
"skyeye-common-const": "1.0.42",
|
|
47
|
-
"swagger-jsdoc": "^
|
|
47
|
+
"swagger-jsdoc": "^6.2.8",
|
|
48
48
|
"typeorm": "^0.3.17",
|
|
49
49
|
"winston": "^3.2.1",
|
|
50
50
|
"winston-daily-rotate-file": "^4.2.1",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
-
import morgan from 'morgan';
|
|
2
|
+
import morgan, { TokenIndexer } from 'morgan';
|
|
3
3
|
import { createStream } from 'rotating-file-stream';
|
|
4
4
|
import { commonAppConfig } from '../appConfig';
|
|
5
5
|
import dateformat from 'dateformat';
|
|
6
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
6
7
|
|
|
7
8
|
// ensure log directory exists
|
|
8
9
|
fs.existsSync(commonAppConfig.LogPath) || fs.mkdirSync(commonAppConfig.LogPath);
|
|
@@ -22,7 +23,7 @@ const accessLogStream = createStream(FileNameGenerator, {
|
|
|
22
23
|
path: commonAppConfig.LogPath
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
const jsonFormat = (tokens:
|
|
26
|
+
const jsonFormat = (tokens: TokenIndexer, req: IncomingMessage, res: ServerResponse) => {
|
|
26
27
|
return JSON.stringify({
|
|
27
28
|
"method": tokens.method(req, res),
|
|
28
29
|
"url": tokens.url(req, res),
|
|
@@ -38,4 +39,4 @@ const jsonFormat = (tokens: any, req: any, res: any) => {
|
|
|
38
39
|
// setup the logger
|
|
39
40
|
export const morganFile = morgan(jsonFormat, { stream: accessLogStream });
|
|
40
41
|
|
|
41
|
-
export const morganConsole =
|
|
42
|
+
export const morganConsole = morgan(jsonFormat);
|