@nest-boot/logger 7.3.7 → 8.0.0-beta.1
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.
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/logger-module-options.interface.d.ts +0 -8
- package/dist/logger-module-options.interface.js +1 -2
- package/dist/logger.d.ts +0 -50
- package/dist/logger.interceptor.d.ts +1 -1
- package/dist/logger.interceptor.js +7 -9
- package/dist/logger.interceptor.js.map +1 -1
- package/dist/logger.js +20 -71
- package/dist/logger.js.map +1 -1
- package/dist/logger.module-definition.d.ts +1 -1
- package/dist/logger.module-definition.js +5 -9
- package/dist/logger.module-definition.js.map +1 -1
- package/dist/logger.module.d.ts +2 -25
- package/dist/logger.module.js +35 -60
- package/dist/logger.module.js.map +1 -1
- package/dist/pino-http.d.ts +6 -0
- package/dist/pino-http.js +4 -0
- package/dist/pino-http.js.map +1 -0
- package/package.json +39 -29
- package/dist/logger.interceptor.spec.d.ts +0 -1
- package/dist/logger.interceptor.spec.js +0 -71
- package/dist/logger.interceptor.spec.js.map +0 -1
- package/dist/logger.module.spec.d.ts +0 -1
- package/dist/logger.module.spec.js +0 -277
- package/dist/logger.module.spec.js.map +0 -1
- package/dist/logger.spec.d.ts +0 -1
- package/dist/logger.spec.js +0 -164
- package/dist/logger.spec.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./logger";
|
|
2
|
-
export * from "./logger.module";
|
|
3
|
-
export * from "./logger-module-options.interface";
|
|
1
|
+
export * from "./logger.js";
|
|
2
|
+
export * from "./logger.module.js";
|
|
3
|
+
export * from "./logger-module-options.interface.js";
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./logger"), exports);
|
|
18
|
-
__exportStar(require("./logger.module"), exports);
|
|
19
|
-
__exportStar(require("./logger-module-options.interface"), exports);
|
|
1
|
+
export * from "./logger.js";
|
|
2
|
+
export * from "./logger.module.js";
|
|
3
|
+
export * from "./logger-module-options.interface.js";
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sCAAsC,CAAC"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { type Options } from "pino-http";
|
|
2
|
-
/**
|
|
3
|
-
* Logger options supported by {@link LoggerModule}.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Pino is an implementation detail. Only the options needed to control HTTP
|
|
7
|
-
* logging, request IDs, output, serialization, formatting, timestamps, and
|
|
8
|
-
* redaction are part of the public API.
|
|
9
|
-
*/
|
|
10
2
|
export type LoggerModuleOptions = Pick<Options, "autoLogging" | "enabled" | "formatters" | "genReqId" | "redact" | "serializers" | "stream" | "timestamp">;
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,69 +1,19 @@
|
|
|
1
1
|
import { type LoggerService } from "@nestjs/common";
|
|
2
2
|
import { type Bindings } from "pino";
|
|
3
|
-
/**
|
|
4
|
-
* Request-scoped structured logger built on top of pino.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* Implements the NestJS {@link LoggerService} interface. Each request
|
|
8
|
-
* gets its own logger context via {@link RequestContext}, supporting
|
|
9
|
-
* request-scoped bindings and automatic context propagation.
|
|
10
|
-
*/
|
|
11
3
|
export declare class Logger implements LoggerService {
|
|
12
4
|
private parentClass;
|
|
13
|
-
/** Configured pino-http middleware supplied by LoggerModule. @internal */
|
|
14
5
|
private readonly loggerMiddleware?;
|
|
15
|
-
/** Current logging context name. @internal */
|
|
16
6
|
private context?;
|
|
17
|
-
/** Fallback pino logger when no request context is active. @internal */
|
|
18
7
|
private globalLogger?;
|
|
19
|
-
/** Creates a new Logger instance.
|
|
20
|
-
* @param parentClass - The parent class that owns this logger instance
|
|
21
|
-
*/
|
|
22
8
|
constructor(parentClass: object);
|
|
23
|
-
/** Returns the current logger context name. */
|
|
24
9
|
getContext(): string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Sets the context name for this logger instance.
|
|
27
|
-
* @param context - The context name (typically the class name)
|
|
28
|
-
*/
|
|
29
10
|
setContext(context: string): void;
|
|
30
|
-
/**
|
|
31
|
-
* Logs a message at the `trace` level.
|
|
32
|
-
* @param message - Log message
|
|
33
|
-
* @param optionalParams - Additional structured data or context override
|
|
34
|
-
*/
|
|
35
11
|
verbose(message: string, ...optionalParams: unknown[]): void;
|
|
36
|
-
/**
|
|
37
|
-
* Logs a message at the `debug` level.
|
|
38
|
-
* @param message - Log message
|
|
39
|
-
* @param optionalParams - Additional structured data or context override
|
|
40
|
-
*/
|
|
41
12
|
debug(message: string, ...optionalParams: unknown[]): void;
|
|
42
|
-
/**
|
|
43
|
-
* Logs a message at the `info` level.
|
|
44
|
-
* @param message - Log message
|
|
45
|
-
* @param optionalParams - Additional structured data or context override
|
|
46
|
-
*/
|
|
47
13
|
log(message: string, ...optionalParams: unknown[]): void;
|
|
48
|
-
/**
|
|
49
|
-
* Logs a message at the `warn` level.
|
|
50
|
-
* @param message - Log message
|
|
51
|
-
* @param optionalParams - Additional structured data or context override
|
|
52
|
-
*/
|
|
53
14
|
warn(message: string, ...optionalParams: unknown[]): void;
|
|
54
|
-
/**
|
|
55
|
-
* Logs a message at the `error` level.
|
|
56
|
-
* @param message - Log message
|
|
57
|
-
* @param optionalParams - Additional structured data or context override
|
|
58
|
-
*/
|
|
59
15
|
error(message: string, ...optionalParams: unknown[]): void;
|
|
60
|
-
/**
|
|
61
|
-
* Merges additional bindings into the current request's log context.
|
|
62
|
-
* @param bindings - Key-value pairs to add to log output
|
|
63
|
-
*/
|
|
64
16
|
assign(bindings: Bindings): void;
|
|
65
|
-
/** Gets the current pino logger from request context or falls back to global. @internal */
|
|
66
17
|
private get pinoLogger();
|
|
67
|
-
/** Dispatches a log message at the given level. @internal */
|
|
68
18
|
private call;
|
|
69
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CallHandler, type ExecutionContext, type NestInterceptor } from "@nestjs/common";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
|
-
import { Logger } from "./logger";
|
|
3
|
+
import { Logger } from "./logger.js";
|
|
4
4
|
export declare class LoggingInterceptor implements NestInterceptor {
|
|
5
5
|
private readonly logger;
|
|
6
6
|
constructor(logger: Logger);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,11 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const logger_1 = require("./logger");
|
|
10
|
+
import { Injectable, } from "@nestjs/common";
|
|
11
|
+
import { Logger } from "./logger.js";
|
|
15
12
|
let LoggingInterceptor = class LoggingInterceptor {
|
|
13
|
+
logger;
|
|
16
14
|
constructor(logger) {
|
|
17
15
|
this.logger = logger;
|
|
18
16
|
}
|
|
@@ -30,9 +28,9 @@ let LoggingInterceptor = class LoggingInterceptor {
|
|
|
30
28
|
return next.handle();
|
|
31
29
|
}
|
|
32
30
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(
|
|
36
|
-
__metadata("design:paramtypes", [logger_1.Logger])
|
|
31
|
+
LoggingInterceptor = __decorate([
|
|
32
|
+
Injectable(),
|
|
33
|
+
__metadata("design:paramtypes", [Logger])
|
|
37
34
|
], LoggingInterceptor);
|
|
35
|
+
export { LoggingInterceptor };
|
|
38
36
|
//# sourceMappingURL=logger.interceptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.interceptor.js","sourceRoot":"","sources":["../src/logger.interceptor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.interceptor.js","sourceRoot":"","sources":["../src/logger.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAGL,UAAU,GAEX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG9B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,SAAS,CAAI,OAAyB,EAAE,IAAoB;QAC1D,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;YACjC,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;YAEzD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;gBACjB,KAAK,EAAE;oBACL,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI;oBACpB,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI;oBACnC,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI;iBACnC;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AAlBY,kBAAkB;IAD9B,UAAU,EAAE;qCAE0B,MAAM;GADhC,kBAAkB,CAkB9B"}
|
package/dist/logger.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,117 +10,67 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const request_context_1 = require("@nest-boot/request-context");
|
|
20
|
-
const common_1 = require("@nestjs/common");
|
|
21
|
-
const core_1 = require("@nestjs/core");
|
|
22
|
-
const pino_1 = __importDefault(require("pino"));
|
|
23
|
-
const logger_module_definition_1 = require("./logger.module-definition");
|
|
24
|
-
/**
|
|
25
|
-
* Request-scoped structured logger built on top of pino.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Implements the NestJS {@link LoggerService} interface. Each request
|
|
29
|
-
* gets its own logger context via {@link RequestContext}, supporting
|
|
30
|
-
* request-scoped bindings and automatic context propagation.
|
|
31
|
-
*/
|
|
13
|
+
import { RequestContext } from "@nest-boot/request-context";
|
|
14
|
+
import { Inject, Injectable, Optional, Scope, } from "@nestjs/common";
|
|
15
|
+
import { INQUIRER } from "@nestjs/core";
|
|
16
|
+
import pino from "pino";
|
|
17
|
+
import { BINDINGS, PINO_HTTP, PINO_LOGGER, } from "./logger.module-definition.js";
|
|
32
18
|
let Logger = class Logger {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
parentClass;
|
|
20
|
+
loggerMiddleware;
|
|
21
|
+
context;
|
|
22
|
+
globalLogger;
|
|
36
23
|
constructor(parentClass) {
|
|
37
24
|
this.parentClass = parentClass;
|
|
38
25
|
this.setContext(this.parentClass?.constructor?.name);
|
|
39
26
|
}
|
|
40
|
-
/** Returns the current logger context name. */
|
|
41
27
|
getContext() {
|
|
42
28
|
return this.context;
|
|
43
29
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Sets the context name for this logger instance.
|
|
46
|
-
* @param context - The context name (typically the class name)
|
|
47
|
-
*/
|
|
48
30
|
setContext(context) {
|
|
49
31
|
this.context = context;
|
|
50
32
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Logs a message at the `trace` level.
|
|
53
|
-
* @param message - Log message
|
|
54
|
-
* @param optionalParams - Additional structured data or context override
|
|
55
|
-
*/
|
|
56
33
|
verbose(message, ...optionalParams) {
|
|
57
34
|
this.call("trace", message, ...optionalParams);
|
|
58
35
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Logs a message at the `debug` level.
|
|
61
|
-
* @param message - Log message
|
|
62
|
-
* @param optionalParams - Additional structured data or context override
|
|
63
|
-
*/
|
|
64
36
|
debug(message, ...optionalParams) {
|
|
65
37
|
this.call("debug", message, ...optionalParams);
|
|
66
38
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Logs a message at the `info` level.
|
|
69
|
-
* @param message - Log message
|
|
70
|
-
* @param optionalParams - Additional structured data or context override
|
|
71
|
-
*/
|
|
72
39
|
log(message, ...optionalParams) {
|
|
73
40
|
this.call("info", message, ...optionalParams);
|
|
74
41
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Logs a message at the `warn` level.
|
|
77
|
-
* @param message - Log message
|
|
78
|
-
* @param optionalParams - Additional structured data or context override
|
|
79
|
-
*/
|
|
80
42
|
warn(message, ...optionalParams) {
|
|
81
43
|
this.call("warn", message, ...optionalParams);
|
|
82
44
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Logs a message at the `error` level.
|
|
85
|
-
* @param message - Log message
|
|
86
|
-
* @param optionalParams - Additional structured data or context override
|
|
87
|
-
*/
|
|
88
45
|
error(message, ...optionalParams) {
|
|
89
46
|
this.call("error", message, ...optionalParams);
|
|
90
47
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Merges additional bindings into the current request's log context.
|
|
93
|
-
* @param bindings - Key-value pairs to add to log output
|
|
94
|
-
*/
|
|
95
48
|
assign(bindings) {
|
|
96
|
-
|
|
97
|
-
...(
|
|
49
|
+
RequestContext.set(BINDINGS, {
|
|
50
|
+
...(RequestContext.get(BINDINGS) ?? {}),
|
|
98
51
|
...bindings,
|
|
99
52
|
});
|
|
100
53
|
}
|
|
101
|
-
/** Gets the current pino logger from request context or falls back to global. @internal */
|
|
102
54
|
get pinoLogger() {
|
|
103
55
|
let pinoLogger;
|
|
104
56
|
try {
|
|
105
|
-
pinoLogger =
|
|
57
|
+
pinoLogger = RequestContext.get(PINO_LOGGER);
|
|
106
58
|
}
|
|
107
59
|
catch {
|
|
108
|
-
//
|
|
109
60
|
}
|
|
110
61
|
if (typeof pinoLogger === "undefined") {
|
|
111
62
|
return (this.loggerMiddleware?.logger ??
|
|
112
63
|
this.globalLogger ??
|
|
113
|
-
(this.globalLogger = (
|
|
64
|
+
(this.globalLogger = pino()));
|
|
114
65
|
}
|
|
115
66
|
return pinoLogger;
|
|
116
67
|
}
|
|
117
|
-
/** Dispatches a log message at the given level. @internal */
|
|
118
68
|
call(level, message, ...optionalParams) {
|
|
119
69
|
let bindings = {};
|
|
120
70
|
try {
|
|
121
|
-
bindings =
|
|
71
|
+
bindings = RequestContext.get(BINDINGS) ?? {};
|
|
122
72
|
}
|
|
123
73
|
catch {
|
|
124
|
-
//
|
|
125
74
|
}
|
|
126
75
|
let context = this.context;
|
|
127
76
|
if (optionalParams.length !== 0) {
|
|
@@ -137,15 +86,15 @@ let Logger = class Logger {
|
|
|
137
86
|
this.pinoLogger[level](bindings, message);
|
|
138
87
|
}
|
|
139
88
|
};
|
|
140
|
-
exports.Logger = Logger;
|
|
141
89
|
__decorate([
|
|
142
|
-
|
|
143
|
-
|
|
90
|
+
Optional(),
|
|
91
|
+
Inject(PINO_HTTP),
|
|
144
92
|
__metadata("design:type", Function)
|
|
145
93
|
], Logger.prototype, "loggerMiddleware", void 0);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
__param(0,
|
|
94
|
+
Logger = __decorate([
|
|
95
|
+
Injectable({ scope: Scope.TRANSIENT }),
|
|
96
|
+
__param(0, Inject(INQUIRER)),
|
|
149
97
|
__metadata("design:paramtypes", [Object])
|
|
150
98
|
], Logger);
|
|
99
|
+
export { Logger };
|
|
151
100
|
//# sourceMappingURL=logger.js.map
|
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,MAAM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Q,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,CAAC;QACH,CAAC;QAED,QAAQ,GAAG,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC;QAEpC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;CACF,CAAA;AAxIkB;IAFhB,QAAQ,EAAE;IACV,MAAM,CAAC,SAAS,CAAC;;gDACiC;AAJxC,MAAM;IADlB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAgBxB,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;;GAflB,MAAM,CA4IlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LoggerModuleOptions } from "./logger-module-options.interface";
|
|
1
|
+
import { type LoggerModuleOptions } from "./logger-module-options.interface.js";
|
|
2
2
|
export declare const PINO_LOGGER: unique symbol;
|
|
3
3
|
export declare const PINO_HTTP: unique symbol;
|
|
4
4
|
export declare const BINDINGS: unique symbol;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
exports.PINO_LOGGER = Symbol("PINO_LOGGER");
|
|
7
|
-
exports.PINO_HTTP = Symbol("PINO_HTTP");
|
|
8
|
-
exports.BINDINGS = Symbol("BINDINGS");
|
|
9
|
-
_a = new common_1.ConfigurableModuleBuilder().build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
|
|
1
|
+
import { ConfigurableModuleBuilder } from "@nestjs/common";
|
|
2
|
+
export const PINO_LOGGER = Symbol("PINO_LOGGER");
|
|
3
|
+
export const PINO_HTTP = Symbol("PINO_HTTP");
|
|
4
|
+
export const BINDINGS = Symbol("BINDINGS");
|
|
5
|
+
export const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE, } = new ConfigurableModuleBuilder().build();
|
|
10
6
|
//# sourceMappingURL=logger.module-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.module-definition.js","sourceRoot":"","sources":["../src/logger.module-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.module-definition.js","sourceRoot":"","sources":["../src/logger.module-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAI3D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,EACX,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,GACnB,GAAG,IAAI,yBAAyB,EAAuB,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/logger.module.d.ts
CHANGED
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
import { type DynamicModule, type OnModuleInit } from "@nestjs/common";
|
|
2
|
-
import { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from "./logger.module-definition";
|
|
3
|
-
import { LoggerModuleOptions } from "./logger-module-options.interface";
|
|
4
|
-
/**
|
|
5
|
-
* Structured logging module powered by Pino.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Provides request-scoped structured logging with automatic request correlation,
|
|
9
|
-
* HTTP logging via pino-http, and a global logging interceptor.
|
|
10
|
-
*/
|
|
2
|
+
import { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from "./logger.module-definition.js";
|
|
3
|
+
import type { LoggerModuleOptions } from "./logger-module-options.interface.js";
|
|
11
4
|
export declare class LoggerModule extends ConfigurableModuleClass implements OnModuleInit {
|
|
12
|
-
/** Complete options passed to the internal pino-http implementation. */
|
|
13
5
|
private readonly options;
|
|
14
|
-
/** Configured pino-http middleware shared by all logger paths. @internal */
|
|
15
6
|
private loggerMiddleware?;
|
|
16
|
-
/**
|
|
17
|
-
* Registers the LoggerModule with the given options.
|
|
18
|
-
* @param options - Supported logger configuration options
|
|
19
|
-
* @returns Dynamic module configuration
|
|
20
|
-
*/
|
|
21
7
|
static register(options: typeof OPTIONS_TYPE): DynamicModule;
|
|
22
|
-
/**
|
|
23
|
-
* Registers the LoggerModule asynchronously with factory functions.
|
|
24
|
-
* @param options - Async configuration options
|
|
25
|
-
* @returns Dynamic module configuration
|
|
26
|
-
*/
|
|
27
8
|
static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule;
|
|
28
|
-
/** Creates a new LoggerModule instance.
|
|
29
|
-
* @param options - Supported logger configuration options
|
|
30
|
-
*/
|
|
31
9
|
constructor(options?: LoggerModuleOptions);
|
|
32
|
-
/** Sets up the pino-http logger and registers it in the request context middleware. */
|
|
33
10
|
onModuleInit(): void;
|
|
34
11
|
}
|
package/dist/logger.module.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11,68 +10,44 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const crypto_1 = require("crypto");
|
|
23
|
-
const pino_http_1 = __importDefault(require("pino-http"));
|
|
24
|
-
const logger_1 = require("./logger");
|
|
25
|
-
const logger_interceptor_1 = require("./logger.interceptor");
|
|
26
|
-
const logger_module_definition_1 = require("./logger.module-definition");
|
|
13
|
+
import { randomUUID } from "node:crypto";
|
|
14
|
+
import { REQUEST, RequestContext, RequestContextModule, RESPONSE, } from "@nest-boot/request-context";
|
|
15
|
+
import { Global, Inject, Module, Optional, } from "@nestjs/common";
|
|
16
|
+
import { APP_INTERCEPTOR } from "@nestjs/core";
|
|
17
|
+
import { LoggingInterceptor } from "./logger.interceptor.js";
|
|
18
|
+
import { Logger } from "./logger.js";
|
|
19
|
+
import { BINDINGS, ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, PINO_HTTP, PINO_LOGGER, } from "./logger.module-definition.js";
|
|
20
|
+
import pinoHttp from "./pino-http.js";
|
|
27
21
|
const pinoHttpProvider = {
|
|
28
|
-
provide:
|
|
29
|
-
inject: [{ token:
|
|
22
|
+
provide: PINO_HTTP,
|
|
23
|
+
inject: [{ token: MODULE_OPTIONS_TOKEN, optional: true }],
|
|
30
24
|
useFactory: (options) => createLoggerMiddleware(options),
|
|
31
25
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @remarks
|
|
36
|
-
* Provides request-scoped structured logging with automatic request correlation,
|
|
37
|
-
* HTTP logging via pino-http, and a global logging interceptor.
|
|
38
|
-
*/
|
|
39
|
-
let LoggerModule = class LoggerModule extends logger_module_definition_1.ConfigurableModuleClass {
|
|
40
|
-
/**
|
|
41
|
-
* Registers the LoggerModule with the given options.
|
|
42
|
-
* @param options - Supported logger configuration options
|
|
43
|
-
* @returns Dynamic module configuration
|
|
44
|
-
*/
|
|
26
|
+
let LoggerModule = class LoggerModule extends ConfigurableModuleClass {
|
|
27
|
+
options;
|
|
28
|
+
loggerMiddleware;
|
|
45
29
|
static register(options) {
|
|
46
30
|
return super.register(options);
|
|
47
31
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Registers the LoggerModule asynchronously with factory functions.
|
|
50
|
-
* @param options - Async configuration options
|
|
51
|
-
* @returns Dynamic module configuration
|
|
52
|
-
*/
|
|
53
32
|
static registerAsync(options) {
|
|
54
33
|
return super.registerAsync(options);
|
|
55
34
|
}
|
|
56
|
-
/** Creates a new LoggerModule instance.
|
|
57
|
-
* @param options - Supported logger configuration options
|
|
58
|
-
*/
|
|
59
35
|
constructor(options = {}) {
|
|
60
36
|
super();
|
|
61
37
|
this.options = createLoggerOptions(options);
|
|
62
38
|
}
|
|
63
|
-
/** Sets up the pino-http logger and registers it in the request context middleware. */
|
|
64
39
|
onModuleInit() {
|
|
65
|
-
const loggerMiddleware = this.loggerMiddleware ?? (this.loggerMiddleware = (
|
|
40
|
+
const loggerMiddleware = this.loggerMiddleware ?? (this.loggerMiddleware = pinoHttp(this.options));
|
|
66
41
|
const logger = loggerMiddleware.logger;
|
|
67
|
-
|
|
68
|
-
const req = ctx.get(
|
|
69
|
-
const res = ctx.get(
|
|
42
|
+
RequestContext.registerMiddleware("logger", async (ctx, next) => {
|
|
43
|
+
const req = ctx.get(REQUEST);
|
|
44
|
+
const res = ctx.get(RESPONSE);
|
|
70
45
|
if (typeof req !== "undefined" && typeof res !== "undefined") {
|
|
71
46
|
loggerMiddleware(req, res);
|
|
72
|
-
ctx.set(
|
|
47
|
+
ctx.set(PINO_LOGGER, req.log.child({ ctx: { id: ctx.id, type: ctx.type } }));
|
|
73
48
|
}
|
|
74
49
|
else {
|
|
75
|
-
ctx.set(
|
|
50
|
+
ctx.set(PINO_LOGGER, logger.child({
|
|
76
51
|
ctx: { id: ctx.id, type: ctx.type },
|
|
77
52
|
}));
|
|
78
53
|
}
|
|
@@ -80,32 +55,32 @@ let LoggerModule = class LoggerModule extends logger_module_definition_1.Configu
|
|
|
80
55
|
});
|
|
81
56
|
}
|
|
82
57
|
};
|
|
83
|
-
exports.LoggerModule = LoggerModule;
|
|
84
58
|
__decorate([
|
|
85
|
-
|
|
86
|
-
|
|
59
|
+
Optional(),
|
|
60
|
+
Inject(PINO_HTTP),
|
|
87
61
|
__metadata("design:type", Function)
|
|
88
62
|
], LoggerModule.prototype, "loggerMiddleware", void 0);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
imports: [
|
|
63
|
+
LoggerModule = __decorate([
|
|
64
|
+
Global(),
|
|
65
|
+
Module({
|
|
66
|
+
imports: [RequestContextModule],
|
|
93
67
|
providers: [
|
|
94
68
|
pinoHttpProvider,
|
|
95
|
-
|
|
69
|
+
Logger,
|
|
96
70
|
{
|
|
97
|
-
provide:
|
|
98
|
-
useClass:
|
|
71
|
+
provide: APP_INTERCEPTOR,
|
|
72
|
+
useClass: LoggingInterceptor,
|
|
99
73
|
},
|
|
100
74
|
],
|
|
101
|
-
exports: [
|
|
75
|
+
exports: [Logger],
|
|
102
76
|
}),
|
|
103
|
-
__param(0,
|
|
104
|
-
__param(0,
|
|
77
|
+
__param(0, Optional()),
|
|
78
|
+
__param(0, Inject(MODULE_OPTIONS_TOKEN)),
|
|
105
79
|
__metadata("design:paramtypes", [Object])
|
|
106
80
|
], LoggerModule);
|
|
81
|
+
export { LoggerModule };
|
|
107
82
|
function createLoggerMiddleware(options) {
|
|
108
|
-
return (
|
|
83
|
+
return pinoHttp(createLoggerOptions(options));
|
|
109
84
|
}
|
|
110
85
|
function createLoggerOptions(options = {}) {
|
|
111
86
|
const { autoLogging, enabled, formatters, genReqId, redact, serializers, stream, timestamp, } = options;
|
|
@@ -120,9 +95,9 @@ function createLoggerOptions(options = {}) {
|
|
|
120
95
|
serializers,
|
|
121
96
|
stream,
|
|
122
97
|
timestamp,
|
|
123
|
-
genReqId: genReqId ?? (() =>
|
|
98
|
+
genReqId: genReqId ?? (() => RequestContext.id ?? randomUUID()),
|
|
124
99
|
customReceivedMessage: () => "request received",
|
|
125
|
-
customProps: () =>
|
|
100
|
+
customProps: () => RequestContext.isActive() ? (RequestContext.get(BINDINGS) ?? {}) : {},
|
|
126
101
|
};
|
|
127
102
|
}
|
|
128
103
|
//# sourceMappingURL=logger.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../src/logger.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../src/logger.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,OAAO,EACP,cAAc,EACd,oBAAoB,EACpB,QAAQ,GACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,MAAM,EACN,MAAM,EACN,MAAM,EAEN,QAAQ,GAET,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAEL,QAAQ,EACR,uBAAuB,EACvB,oBAAoB,EAEpB,SAAS,EACT,WAAW,GACZ,MAAM,+BAA+B,CAAC;AAEvC,OAAO,QAAiC,MAAM,gBAAgB,CAAC;AAE/D,MAAM,gBAAgB,GAA6B;IACjD,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzD,UAAU,EAAE,CAAC,OAA6B,EAAE,EAAE,CAC5C,sBAAsB,CAAC,OAAO,CAAC;CAClC,CAAC;AAsBK,IAAM,YAAY,GAAlB,MAAM,YACX,SAAQ,uBAAuB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,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,IAAI,UAAU,EAAE,CAAC;QAC/D,qBAAqB,EAAE,GAAG,EAAE,CAAC,kBAAkB;QAC/C,WAAW,EAAE,GAAG,EAAE,CAChB,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Request, type Response } from "express";
|
|
2
|
+
import { type HttpLogger } from "pino-http";
|
|
3
|
+
import { type LoggerModuleOptions } from "./logger-module-options.interface.js";
|
|
4
|
+
export type PinoHttpLogger = HttpLogger<Request, Response>;
|
|
5
|
+
declare const pinoHttp: (options?: LoggerModuleOptions) => PinoHttpLogger;
|
|
6
|
+
export default pinoHttp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pino-http.js","sourceRoot":"","sources":["../src/pino-http.ts"],"names":[],"mappings":"AACA,OAAO,cAAmC,MAAM,WAAW,CAAC;AAM5D,MAAM,QAAQ,GAAG,cAEE,CAAC;AAEpB,eAAe,QAAQ,CAAC"}
|