@bymax-one/nest-logger 1.4.21 → 1.4.23
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/CHANGELOG.md +157 -1
- package/README.md +14 -3
- package/dist/server/index.cjs +340 -137
- package/dist/server/index.d.cts +33 -17
- package/dist/server/index.d.ts +33 -17
- package/dist/server/index.mjs +340 -137
- package/package.json +1 -1
package/dist/server/index.d.cts
CHANGED
|
@@ -618,8 +618,28 @@ interface BymaxLoggerModuleOptions {
|
|
|
618
618
|
http?: HttpOptions;
|
|
619
619
|
/** OpenTelemetry integration tuning. */
|
|
620
620
|
otel?: OtelOptions;
|
|
621
|
-
/** Maximum size in bytes per log entry. Default: 65536. */
|
|
621
|
+
/** Maximum size in bytes per log entry: an integer from 1 to 2147483647. Default: 65536. */
|
|
622
622
|
maxEntrySizeBytes?: number;
|
|
623
|
+
/**
|
|
624
|
+
* The most characters a string of a log record is written with. A longer string is cut to this
|
|
625
|
+
* many characters, without splitting a surrogate pair, and ends with `…[truncated]`, so what is
|
|
626
|
+
* written is up to 12 characters longer than the limit. An integer from 64 to 2147483647.
|
|
627
|
+
* Default: not set, and a string is written whole.
|
|
628
|
+
*
|
|
629
|
+
* Applies to every string value of the record at any depth, but not to a key, a value that is
|
|
630
|
+
* not text, the log message (already capped at 16384 characters), the `logKey`, the bindings of a
|
|
631
|
+
* logger (the service identity and a `context`), a value a redaction rule censors, or anything
|
|
632
|
+
* under a key that has a serializer (`err` and the keys of `serializers`; see
|
|
633
|
+
* `maxEntrySizeBytes`), so the stack of an error logged under `err` is never cut by it. The event
|
|
634
|
+
* name and the `exception.*` and `error.type` fields the library writes are added after the cut,
|
|
635
|
+
* so the limit does not apply to them, and a key of your own with one of those names is cut like
|
|
636
|
+
* any other. The names left whole are matched on the root key, so a key of your own named like a
|
|
637
|
+
* serializer key is left whole too. An `Error` placed in the metadata under any other key is
|
|
638
|
+
* data of the record when the cut runs, and its message and stack are cut like any other string.
|
|
639
|
+
* A string the caller supplies, such as a `userId` longer than the limit, is cut like any other.
|
|
640
|
+
* A `redactCensor` longer than the limit is refused at startup, so a censor is never cut.
|
|
641
|
+
*/
|
|
642
|
+
maxStringLength?: number;
|
|
623
643
|
/**
|
|
624
644
|
* The longest a destination's `onInit` or `onRegistryReady` may take, in milliseconds. Default:
|
|
625
645
|
* 10000. An integer from 1 to 2147483647 (the largest delay a timer holds).
|
|
@@ -669,7 +689,8 @@ interface BymaxLoggerModuleOptions {
|
|
|
669
689
|
* middleware) consumes — distinct from the loosely-typed
|
|
670
690
|
* `BymaxLoggerModuleOptions` the consumer supplies.
|
|
671
691
|
*/
|
|
672
|
-
type ResolvedBymaxLoggerModuleOptions = Readonly<Required<Omit<BymaxLoggerModuleOptions, 'http' | 'otel' | 'shutdown' | 'destinationQueue'>> & {
|
|
692
|
+
type ResolvedBymaxLoggerModuleOptions = Readonly<Required<Omit<BymaxLoggerModuleOptions, 'http' | 'otel' | 'shutdown' | 'destinationQueue' | 'maxStringLength'>> & {
|
|
693
|
+
maxStringLength: number | undefined;
|
|
673
694
|
http: ResolvedHttpOptions;
|
|
674
695
|
otel: Required<OtelOptions>;
|
|
675
696
|
shutdown: Required<ShutdownOptions>;
|
|
@@ -1051,6 +1072,16 @@ declare class PinoLoggerService implements LoggerService, OnApplicationShutdown
|
|
|
1051
1072
|
/** Emit a structured payload at info or warn level. */
|
|
1052
1073
|
private emitStructured;
|
|
1053
1074
|
/** Emit a NestJS-style variadic log, dispatching by level without computed indexing. */
|
|
1075
|
+
private nestStyleMessage;
|
|
1076
|
+
/**
|
|
1077
|
+
* The entry text of an object message, censored under the names of the field it came from and cut
|
|
1078
|
+
* like that field: the text is a copy of it, and a copy made outside the pipeline would carry a
|
|
1079
|
+
* value the pipeline censors or cuts in the field itself.
|
|
1080
|
+
*
|
|
1081
|
+
* @param text - The text and the member it came from.
|
|
1082
|
+
* @returns The censored text, or an empty one when the redactor cannot be applied.
|
|
1083
|
+
*/
|
|
1084
|
+
private censorText;
|
|
1054
1085
|
private emitNestStyle;
|
|
1055
1086
|
}
|
|
1056
1087
|
|
|
@@ -1401,21 +1432,6 @@ declare class PrettyDevDestination implements ILogDestination {
|
|
|
1401
1432
|
* message telling the consumer to install it or drop this destination.
|
|
1402
1433
|
*/
|
|
1403
1434
|
onInit(): Promise<void>;
|
|
1404
|
-
/** Refuse to start when `NODE_ENV` is `production`. */
|
|
1405
|
-
private refuseInProduction;
|
|
1406
|
-
/**
|
|
1407
|
-
* Resolve `pino-pretty` and build the colorized transform that renders to `process.stdout`.
|
|
1408
|
-
*
|
|
1409
|
-
* @returns The transform every entry is written to.
|
|
1410
|
-
*/
|
|
1411
|
-
private buildTransform;
|
|
1412
|
-
/**
|
|
1413
|
-
* Mark the destination as failed and build the error `onInit` rejects with.
|
|
1414
|
-
*
|
|
1415
|
-
* @param cause - What the import or `build()` threw.
|
|
1416
|
-
* @returns The error to throw.
|
|
1417
|
-
*/
|
|
1418
|
-
private initFailure;
|
|
1419
1435
|
/**
|
|
1420
1436
|
* Write a serialized NDJSON entry to the pretty transform.
|
|
1421
1437
|
*
|
package/dist/server/index.d.ts
CHANGED
|
@@ -618,8 +618,28 @@ interface BymaxLoggerModuleOptions {
|
|
|
618
618
|
http?: HttpOptions;
|
|
619
619
|
/** OpenTelemetry integration tuning. */
|
|
620
620
|
otel?: OtelOptions;
|
|
621
|
-
/** Maximum size in bytes per log entry. Default: 65536. */
|
|
621
|
+
/** Maximum size in bytes per log entry: an integer from 1 to 2147483647. Default: 65536. */
|
|
622
622
|
maxEntrySizeBytes?: number;
|
|
623
|
+
/**
|
|
624
|
+
* The most characters a string of a log record is written with. A longer string is cut to this
|
|
625
|
+
* many characters, without splitting a surrogate pair, and ends with `…[truncated]`, so what is
|
|
626
|
+
* written is up to 12 characters longer than the limit. An integer from 64 to 2147483647.
|
|
627
|
+
* Default: not set, and a string is written whole.
|
|
628
|
+
*
|
|
629
|
+
* Applies to every string value of the record at any depth, but not to a key, a value that is
|
|
630
|
+
* not text, the log message (already capped at 16384 characters), the `logKey`, the bindings of a
|
|
631
|
+
* logger (the service identity and a `context`), a value a redaction rule censors, or anything
|
|
632
|
+
* under a key that has a serializer (`err` and the keys of `serializers`; see
|
|
633
|
+
* `maxEntrySizeBytes`), so the stack of an error logged under `err` is never cut by it. The event
|
|
634
|
+
* name and the `exception.*` and `error.type` fields the library writes are added after the cut,
|
|
635
|
+
* so the limit does not apply to them, and a key of your own with one of those names is cut like
|
|
636
|
+
* any other. The names left whole are matched on the root key, so a key of your own named like a
|
|
637
|
+
* serializer key is left whole too. An `Error` placed in the metadata under any other key is
|
|
638
|
+
* data of the record when the cut runs, and its message and stack are cut like any other string.
|
|
639
|
+
* A string the caller supplies, such as a `userId` longer than the limit, is cut like any other.
|
|
640
|
+
* A `redactCensor` longer than the limit is refused at startup, so a censor is never cut.
|
|
641
|
+
*/
|
|
642
|
+
maxStringLength?: number;
|
|
623
643
|
/**
|
|
624
644
|
* The longest a destination's `onInit` or `onRegistryReady` may take, in milliseconds. Default:
|
|
625
645
|
* 10000. An integer from 1 to 2147483647 (the largest delay a timer holds).
|
|
@@ -669,7 +689,8 @@ interface BymaxLoggerModuleOptions {
|
|
|
669
689
|
* middleware) consumes — distinct from the loosely-typed
|
|
670
690
|
* `BymaxLoggerModuleOptions` the consumer supplies.
|
|
671
691
|
*/
|
|
672
|
-
type ResolvedBymaxLoggerModuleOptions = Readonly<Required<Omit<BymaxLoggerModuleOptions, 'http' | 'otel' | 'shutdown' | 'destinationQueue'>> & {
|
|
692
|
+
type ResolvedBymaxLoggerModuleOptions = Readonly<Required<Omit<BymaxLoggerModuleOptions, 'http' | 'otel' | 'shutdown' | 'destinationQueue' | 'maxStringLength'>> & {
|
|
693
|
+
maxStringLength: number | undefined;
|
|
673
694
|
http: ResolvedHttpOptions;
|
|
674
695
|
otel: Required<OtelOptions>;
|
|
675
696
|
shutdown: Required<ShutdownOptions>;
|
|
@@ -1051,6 +1072,16 @@ declare class PinoLoggerService implements LoggerService, OnApplicationShutdown
|
|
|
1051
1072
|
/** Emit a structured payload at info or warn level. */
|
|
1052
1073
|
private emitStructured;
|
|
1053
1074
|
/** Emit a NestJS-style variadic log, dispatching by level without computed indexing. */
|
|
1075
|
+
private nestStyleMessage;
|
|
1076
|
+
/**
|
|
1077
|
+
* The entry text of an object message, censored under the names of the field it came from and cut
|
|
1078
|
+
* like that field: the text is a copy of it, and a copy made outside the pipeline would carry a
|
|
1079
|
+
* value the pipeline censors or cuts in the field itself.
|
|
1080
|
+
*
|
|
1081
|
+
* @param text - The text and the member it came from.
|
|
1082
|
+
* @returns The censored text, or an empty one when the redactor cannot be applied.
|
|
1083
|
+
*/
|
|
1084
|
+
private censorText;
|
|
1054
1085
|
private emitNestStyle;
|
|
1055
1086
|
}
|
|
1056
1087
|
|
|
@@ -1401,21 +1432,6 @@ declare class PrettyDevDestination implements ILogDestination {
|
|
|
1401
1432
|
* message telling the consumer to install it or drop this destination.
|
|
1402
1433
|
*/
|
|
1403
1434
|
onInit(): Promise<void>;
|
|
1404
|
-
/** Refuse to start when `NODE_ENV` is `production`. */
|
|
1405
|
-
private refuseInProduction;
|
|
1406
|
-
/**
|
|
1407
|
-
* Resolve `pino-pretty` and build the colorized transform that renders to `process.stdout`.
|
|
1408
|
-
*
|
|
1409
|
-
* @returns The transform every entry is written to.
|
|
1410
|
-
*/
|
|
1411
|
-
private buildTransform;
|
|
1412
|
-
/**
|
|
1413
|
-
* Mark the destination as failed and build the error `onInit` rejects with.
|
|
1414
|
-
*
|
|
1415
|
-
* @param cause - What the import or `build()` threw.
|
|
1416
|
-
* @returns The error to throw.
|
|
1417
|
-
*/
|
|
1418
|
-
private initFailure;
|
|
1419
1435
|
/**
|
|
1420
1436
|
* Write a serialized NDJSON entry to the pretty transform.
|
|
1421
1437
|
*
|