@bymax-one/nest-logger 1.4.9 → 1.4.11

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.
@@ -251,6 +251,8 @@ interface EmittedDeploymentResource {
251
251
  * can branch on shape without runtime discrimination.
252
252
  */
253
253
 
254
+ /** Which of an error's own fields are written: every one, or an allow-list. See `errorOwnFields`. */
255
+ type ErrorOwnFieldsMode = 'all' | 'safe';
254
256
  /**
255
257
  * HTTP module configuration — used by the optional HTTP interceptor and filter.
256
258
  *
@@ -426,6 +428,26 @@ interface BymaxLoggerModuleOptions {
426
428
  otel?: OtelOptions;
427
429
  /** Maximum size in bytes per log entry. Default: 65536. */
428
430
  maxEntrySizeBytes?: number;
431
+ /**
432
+ * Which of an error's own fields are written beside its `type`, `message`, `stack` and `cause`.
433
+ *
434
+ * - `'all'` (default) writes every own field, at every depth of the chain and for an `Error`
435
+ * nested in the metadata. A binary value (a Buffer, a typed array, a DataView, or a member of an
436
+ * array) is written as its size, such as `[Binary 42 bytes]`, never as bytes.
437
+ * - `'safe'` writes only an allow-list of operational names (`code`, `errno`, `syscall`,
438
+ * `signal`, `status`, `statusCode`, `address`, `port`, `hostname`, and the PostgreSQL
439
+ * `constraint`, `table`, `column`, `schema`, `routine`) plus {@link errorOwnFieldNames}. Node's
440
+ * own errors carry values (a child process's `stdout`, an `AssertionError`'s `actual` and
441
+ * `expected`, a file system `path`), and a list of names to drop cannot name them all.
442
+ *
443
+ * Recommended: `'safe'`. The default stays `'all'` for the 1.x line.
444
+ */
445
+ errorOwnFields?: ErrorOwnFieldsMode;
446
+ /**
447
+ * Own-field names written in `'safe'` mode beside the default list, matched exactly (case
448
+ * included). Ignored in `'all'` mode. Default: none.
449
+ */
450
+ errorOwnFieldNames?: readonly string[];
429
451
  /** Custom Pino serializers, merged with defaults. */
430
452
  serializers?: Record<string, (input: unknown) => unknown>;
431
453
  /** Custom timestamp function. Default: `() => new Date().toISOString()`. */
@@ -1939,4 +1961,4 @@ interface LogEntry {
1939
1961
  declare const LOG_KEYS_CONVENTION_REGEX: RegExp;
1940
1962
 
1941
1963
  export { BymaxLoggerModule, DEFAULT_REDACT_PATHS, DefaultStdoutDestination, HttpAccessLogMiddleware, HttpExceptionFilter, HttpLoggingInterceptor, InjectLogger, LOGGER_DESTINATIONS_TOKEN, LOGGER_OPTIONS_TOKEN, LOGGER_PINO_INSTANCE_TOKEN, LOGGER_REDACTOR_TOKEN, LOG_CONTEXT_METADATA_KEY, LOG_CONTEXT_TOKEN, LOG_KEYS_CONVENTION_REGEX, LogContext, LogContextService, LogPerformance, PINO_LEVEL_NAMES, PINO_LEVEL_NUMBERS, PinoLoggerService, PinoUnexpectedErrorSink, PrettyDevDestination, REDACT_COMMON_FIELDS, RESERVED_LOG_KEYS, RESERVED_LOG_KEYS_NOT_EMITTED, RequestIdMiddleware, applyAccessLog, applyRequestIdMiddleware, isValidTraceId };
1942
- export type { BymaxLoggerModuleAsyncOptions, BymaxLoggerModuleOptions, BymaxLoggerModuleOptionsFactory, EmittedDeploymentResource, EmittedServiceResource, HttpOptions, ILogDestination, IUnexpectedErrorSink, IncomingHeaders, LogContext$1 as LogContextBag, LogEntry, LogLevel, LoggableRequest, LoggableResponse, NextHandler, OtelOptions, PrettyViewOptions, ReservedLogKey, ResolvedBymaxLoggerModuleOptions, ResolvedServiceMetadata, ServiceMetadata, UnexpectedErrorReport };
1964
+ export type { BymaxLoggerModuleAsyncOptions, BymaxLoggerModuleOptions, BymaxLoggerModuleOptionsFactory, EmittedDeploymentResource, EmittedServiceResource, ErrorOwnFieldsMode, HttpOptions, ILogDestination, IUnexpectedErrorSink, IncomingHeaders, LogContext$1 as LogContextBag, LogEntry, LogLevel, LoggableRequest, LoggableResponse, NextHandler, OtelOptions, PrettyViewOptions, ReservedLogKey, ResolvedBymaxLoggerModuleOptions, ResolvedServiceMetadata, ServiceMetadata, UnexpectedErrorReport };
@@ -251,6 +251,8 @@ interface EmittedDeploymentResource {
251
251
  * can branch on shape without runtime discrimination.
252
252
  */
253
253
 
254
+ /** Which of an error's own fields are written: every one, or an allow-list. See `errorOwnFields`. */
255
+ type ErrorOwnFieldsMode = 'all' | 'safe';
254
256
  /**
255
257
  * HTTP module configuration — used by the optional HTTP interceptor and filter.
256
258
  *
@@ -426,6 +428,26 @@ interface BymaxLoggerModuleOptions {
426
428
  otel?: OtelOptions;
427
429
  /** Maximum size in bytes per log entry. Default: 65536. */
428
430
  maxEntrySizeBytes?: number;
431
+ /**
432
+ * Which of an error's own fields are written beside its `type`, `message`, `stack` and `cause`.
433
+ *
434
+ * - `'all'` (default) writes every own field, at every depth of the chain and for an `Error`
435
+ * nested in the metadata. A binary value (a Buffer, a typed array, a DataView, or a member of an
436
+ * array) is written as its size, such as `[Binary 42 bytes]`, never as bytes.
437
+ * - `'safe'` writes only an allow-list of operational names (`code`, `errno`, `syscall`,
438
+ * `signal`, `status`, `statusCode`, `address`, `port`, `hostname`, and the PostgreSQL
439
+ * `constraint`, `table`, `column`, `schema`, `routine`) plus {@link errorOwnFieldNames}. Node's
440
+ * own errors carry values (a child process's `stdout`, an `AssertionError`'s `actual` and
441
+ * `expected`, a file system `path`), and a list of names to drop cannot name them all.
442
+ *
443
+ * Recommended: `'safe'`. The default stays `'all'` for the 1.x line.
444
+ */
445
+ errorOwnFields?: ErrorOwnFieldsMode;
446
+ /**
447
+ * Own-field names written in `'safe'` mode beside the default list, matched exactly (case
448
+ * included). Ignored in `'all'` mode. Default: none.
449
+ */
450
+ errorOwnFieldNames?: readonly string[];
429
451
  /** Custom Pino serializers, merged with defaults. */
430
452
  serializers?: Record<string, (input: unknown) => unknown>;
431
453
  /** Custom timestamp function. Default: `() => new Date().toISOString()`. */
@@ -1939,4 +1961,4 @@ interface LogEntry {
1939
1961
  declare const LOG_KEYS_CONVENTION_REGEX: RegExp;
1940
1962
 
1941
1963
  export { BymaxLoggerModule, DEFAULT_REDACT_PATHS, DefaultStdoutDestination, HttpAccessLogMiddleware, HttpExceptionFilter, HttpLoggingInterceptor, InjectLogger, LOGGER_DESTINATIONS_TOKEN, LOGGER_OPTIONS_TOKEN, LOGGER_PINO_INSTANCE_TOKEN, LOGGER_REDACTOR_TOKEN, LOG_CONTEXT_METADATA_KEY, LOG_CONTEXT_TOKEN, LOG_KEYS_CONVENTION_REGEX, LogContext, LogContextService, LogPerformance, PINO_LEVEL_NAMES, PINO_LEVEL_NUMBERS, PinoLoggerService, PinoUnexpectedErrorSink, PrettyDevDestination, REDACT_COMMON_FIELDS, RESERVED_LOG_KEYS, RESERVED_LOG_KEYS_NOT_EMITTED, RequestIdMiddleware, applyAccessLog, applyRequestIdMiddleware, isValidTraceId };
1942
- export type { BymaxLoggerModuleAsyncOptions, BymaxLoggerModuleOptions, BymaxLoggerModuleOptionsFactory, EmittedDeploymentResource, EmittedServiceResource, HttpOptions, ILogDestination, IUnexpectedErrorSink, IncomingHeaders, LogContext$1 as LogContextBag, LogEntry, LogLevel, LoggableRequest, LoggableResponse, NextHandler, OtelOptions, PrettyViewOptions, ReservedLogKey, ResolvedBymaxLoggerModuleOptions, ResolvedServiceMetadata, ServiceMetadata, UnexpectedErrorReport };
1964
+ export type { BymaxLoggerModuleAsyncOptions, BymaxLoggerModuleOptions, BymaxLoggerModuleOptionsFactory, EmittedDeploymentResource, EmittedServiceResource, ErrorOwnFieldsMode, HttpOptions, ILogDestination, IUnexpectedErrorSink, IncomingHeaders, LogContext$1 as LogContextBag, LogEntry, LogLevel, LoggableRequest, LoggableResponse, NextHandler, OtelOptions, PrettyViewOptions, ReservedLogKey, ResolvedBymaxLoggerModuleOptions, ResolvedServiceMetadata, ServiceMetadata, UnexpectedErrorReport };