nest-logger-bundle 0.1.5 → 1.0.0

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.
Files changed (35) hide show
  1. package/README.md +152 -104
  2. package/dist/lib/bundle/context/async-logger-context.service.d.ts +3 -3
  3. package/dist/lib/bundle/context/async-logger-context.service.js +12 -15
  4. package/dist/lib/bundle/context/async-logger-context.service.js.map +1 -1
  5. package/dist/lib/bundle/logger-bundle.service.js +1 -1
  6. package/dist/lib/bundle/logger-bundle.service.js.map +1 -1
  7. package/dist/lib/core/index.d.ts +2 -1
  8. package/dist/lib/core/index.js +2 -1
  9. package/dist/lib/core/index.js.map +1 -1
  10. package/dist/lib/core/providers/bundle-logger.provider.d.ts +2 -0
  11. package/dist/lib/core/providers/bundle-logger.provider.js +25 -0
  12. package/dist/lib/core/providers/bundle-logger.provider.js.map +1 -0
  13. package/dist/lib/core/providers/pretty-logger.provider.d.ts +2 -0
  14. package/dist/lib/core/providers/pretty-logger.provider.js +26 -0
  15. package/dist/lib/core/providers/pretty-logger.provider.js.map +1 -0
  16. package/dist/lib/core/providers/utils.d.ts +3 -0
  17. package/dist/lib/core/providers/utils.js +47 -0
  18. package/dist/lib/core/providers/utils.js.map +1 -0
  19. package/dist/lib/logger/internal-logger.service.d.ts +3 -2
  20. package/dist/lib/logger/internal-logger.service.js +9 -6
  21. package/dist/lib/logger/internal-logger.service.js.map +1 -1
  22. package/dist/lib/logger/logger.service.d.ts +3 -1
  23. package/dist/lib/logger/logger.service.js +14 -2
  24. package/dist/lib/logger/logger.service.js.map +1 -1
  25. package/dist/lib/nest-logger.module.d.ts +2 -2
  26. package/dist/lib/nest-logger.module.js +12 -7
  27. package/dist/lib/nest-logger.module.js.map +1 -1
  28. package/dist/lib/nest-logger.params.d.ts +24 -22
  29. package/dist/lib/nest-logger.params.js +8 -14
  30. package/dist/lib/nest-logger.params.js.map +1 -1
  31. package/dist/lib/tsconfig.lib.tsbuildinfo +1 -1
  32. package/package.json +6 -6
  33. package/dist/lib/core/providers/pino-logger.provider.d.ts +0 -2
  34. package/dist/lib/core/providers/pino-logger.provider.js +0 -56
  35. package/dist/lib/core/providers/pino-logger.provider.js.map +0 -1
package/README.md CHANGED
@@ -1,50 +1,49 @@
1
1
  <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="" width="120" alt="Nest Logo" /></a>
2
+ <a href="http://nestjs.com/" target="blank"><img src="./logger-bundle.png" width="250" alt="Nest Logo" /></a>
3
3
  </p>
4
4
 
5
- [travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
6
- [travis-url]: https://travis-ci.org/nestjs/nest
7
- [linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
8
- [linux-url]: https://travis-ci.org/nestjs/nest
9
-
10
5
  <p align="center">A flexible Logger created to use with <a href="http://nodejs.org" target="blank">Nest.js</a> framework for wrap all logs with an Request or Async context in a bundle.</p>
11
6
  <p align="center">
12
- <a href="https://www.npmjs.com/package/@pedrohcdo/nest-logger-bundle"><img src="https://img.shields.io/npm/v/@pedrohcdo/nest-logger-bundle" alt="NPM Version" /></a>
7
+ <a href="https://www.npmjs.com/package/nest-logger-bundle"><img src="https://img.shields.io/npm/v/nest-logger-bundle" alt="NPM Version" /></a>
13
8
  <a href="https://github.com/pedrohcdo/nest-logger-bundle/blob/master/LICENSE"><img src="https://img.shields.io/github/license/pedrohcdo/nest-logger-bundle" alt="Package License" /></a>
14
9
  <a href="https://snyk.io/test/github/pedrohcdo/nest-logger-bundle">
15
- <img alt="Snyk Vulnerabilities for npm package" src="https://img.shields.io/snyk/vulnerabilities/npm/@pedrohcdo/nest-logger-bundle" />
10
+ <img alt="Snyk Vulnerabilities for npm package" src="https://img.shields.io/snyk/vulnerabilities/npm/nest-logger-bundle" />
16
11
  </a>
12
+ <img alt="Libraries.io" src="https://img.shields.io/librariesio/release/npm/nest-logger-bundle">
13
+ <img alt="Supported Language: Typescript" src="https://img.shields.io/npm/types/typescript" />
14
+ <img alt="Supported platforms: Express & Fastify" src="https://img.shields.io/badge/platforms-Express%20%26%20Fastify-green" />
17
15
  </p>
18
16
 
19
17
  ## Description
20
18
 
21
- This library made to be used with <a href="http://nodejs.org" target="blank">Nest.js</a> it offers more flexibility for controlling logs in the application. The strongest point is that it offers a way to pack all the logs originating from an request or some asynchronous flow into a single bundle, also later it provides ways to transport the bundles to some cloud observability service.
22
-
23
- For example, in a request several logs can occur and organizing this later or finding yourself in the middle of so many logs becomes a complicated task, with the LoggerBundle all the logs that occur in that request will be packed in a bundle and this bundle shows exactly the order that these logs were displayed in a tree, you can even create branches of these logs using the `enter()/ exit()` methods as will be explained later. This bundle will include a lot of useful information, such as the request that originated these logs and in the log tree you will be able to see a time profiling telling you how long it took in each branch tree.
24
-
25
- Don't worry if some function of a service calls other functions of other services that contain another injected LoggerBundle, because it can find itself within the current context of the request, so no matter how many different services interact, the output will be in the same bundle.
19
+ This library made to be used with <a href="http://nodejs.org" target="blank">Nest.js</a> it offers more flexibility for controlling logs in the application. The strongest point is that it offers a way to pack all the logs originating from an request or some asynchronous flow into a single bundle, you can also decide what to do with this bundle as well as regular logs.
26
20
 
27
- ________________
28
-
29
- ## Internal Dependencies
21
+ For example, in a request several logs can occur and organizing this later or finding yourself in the middle of so many logs becomes a complicated task, with the `LoggerBundle` all the logs that occur in that request will be packed in a bundle and this bundle shows exactly the order that these logs were occurred using a tree, you can even create branches of these logs using the `enter()/ exit()` methods as will be explained later. This bundle will include a lot of useful information, such as the request that originated these logs and in the log tree you will be able to see a time profiling telling you how long it took in each branch tree.
30
22
 
31
- You don't need to install any extra dependencies. Internally this library is also made using some bases that are made on top of the <a href="https://github.com/pinojs/pino" target="blank">pino</a>, but I have plans to expose this dependencies in the future and leave the user free to choose which one to use.
23
+ Inside it works based on a context, be it a request or an asynchronous flow, so you can inject the `LoggerBundle` into any desired service and all calls between these services work correctly, so all logs occurring in a given request will be packed in the same bundle.
32
24
 
33
25
  ________________
34
26
 
35
27
  ## Installation
36
28
 
37
29
  ```bash
38
- $ npm i --save @pedrohcdo/nest-logger-bundle
30
+ $ npm i --save nest-logger-bundle
39
31
  ```
40
32
 
41
- ## Samples
42
33
 
43
34
  ________________
44
35
 
36
+ ## Internal Dependencies
37
+
38
+ You don't need to install any extra dependencies. Internally this library is also made using some bases that are made on top of the <a href="https://github.com/pinojs/pino" target="blank">pino</a>. If you need to use some transporter you will need to configure the streams, for that, follow this [section](#streams)
39
+
40
+ ________________
41
+
42
+ ## Samples
43
+
45
44
  If you want to see some usage examples use this repo <a href="https://github.com/pedrohcdo/nest-logger-bundle-samples" target="blank">NestLoggerBundleSamples</a>, In it you will find some projects with some use cases, the codes are commented for a better understanding.
46
45
 
47
- > If you want to see an simple example of how to configure it, see the test project [Example](test).
46
+ > But if you want to see an simple example of how to configure it, see the test project [Example](test).
48
47
 
49
48
  ________________
50
49
 
@@ -59,7 +58,7 @@ import {
59
58
  NestLoggerModule,
60
59
  LoggerExceptionFilter,
61
60
  LoggerHttpInterceptor
62
- } from '@pedrohcd/nest-logger';
61
+ } from 'nest-logger-bundle';
63
62
 
64
63
 
65
64
  //
@@ -90,7 +89,7 @@ export class GlobalModule {}
90
89
  For the LoggerBundle to work correctly, it needs some points to be handled, for that there are two classes that are used to handle requests and errors, they are: `LoggerExceptionFilter` and `LoggerHttpInterceptor`.
91
90
  These classes need to be used in the global-scoped filters and interceptors like the example to be work across the whole application. `Remember to provide this filter and interceptor as in the example above in a global module or in the main module of your application.`
92
91
 
93
- > If you already have a global scope filter or interceptor, follow the [tutorial](#custom-filter-and-interceptor)
92
+ > If you already have a global scope filter or interceptor on your project, follow the [tutorial](#custom-filter-and-interceptor)
94
93
 
95
94
  ### Injecting LoggerBundle
96
95
 
@@ -146,12 +145,17 @@ export class SampleUserService {
146
145
 
147
146
  > Remembering that the name of the current service can be acquired by `<Class>.name`, so you can change the name of the context of the LoggerBundle right at the beginning using as shown in the example above: `this.logService.setContextToken(SampleService.name)`
148
147
 
149
- If the `SampleUserService.createUser(email, username)` function is called, the log structure that will be generated will be like the example below:
148
+ ________________
149
+
150
+ ## Bundle Structure
151
+
152
+
153
+ The bundle is generated at the end of a flow such as a request, after that the generated bundle is dispatched according to the parameters passed in the module configuration (`the complete configuration can be seen here `[Setting-up](#setting-up)). Para demonstrar como é a estrutura do bundle vamos usar o exemplo acima [Injecting LoggerBundle](#injecting-loggerbundle), if the `SampleUserService.createUser(email, username)` function is called, the bundle structure that will be generated will be like the example below:
150
154
 
151
155
  ```json
152
156
  {
153
157
  logs: {
154
- "profiling": "6ms",
158
+ "profiling": <duration>,
155
159
  "name": "root",
156
160
  "logs": [
157
161
  {
@@ -160,7 +164,7 @@ If the `SampleUserService.createUser(email, username)` function is called, the l
160
164
  "context": "SampleService"
161
165
  },
162
166
  {
163
- "profiling": "0ms",
167
+ "profiling": <duration>,
164
168
  "name": "creating user",
165
169
  "logs": [
166
170
  {
@@ -169,7 +173,7 @@ If the `SampleUserService.createUser(email, username)` function is called, the l
169
173
  "context": "SampleService"
170
174
  },
171
175
  {
172
- "profiling": "0ms",
176
+ "profiling": <duration>,
173
177
  "name": "finding user by email ",
174
178
  "logs": [
175
179
  {
@@ -192,27 +196,27 @@ If the `SampleUserService.createUser(email, username)` function is called, the l
192
196
  "requestDuration": <duration>,
193
197
  "method": "GET",
194
198
  "path": "/sample/create-user/teste%40teste.com/Teste%20123",
195
- "ip": <ip>
196
- },
197
- tags: {
198
- "test": "test 123"
199
+ "ip": <ip>,
200
+ tags: {
201
+ "test": "test 123"
202
+ },
199
203
  },
200
204
  req: <request object>,
201
205
  res: <response object>
202
206
  }
203
207
  ```
204
208
 
205
- The log will display 5 objects, they are:
209
+ The bundle will contain these 5 objects
206
210
 
207
211
  | Object | Description
208
212
  | :--- | :----:
209
- | `logs` | A bundle containing the entire log tree including a time profiling between each log.
210
- | `context` | The context in which this log bundle was created, containing information such as api path, method..
211
- | `tags` | The tags created in this context
212
- | `req` | The body of the request that originated this bundle
213
- | `res` | If it is a complete request context here you will be able to see the response of that request
213
+ | ***logs*** | A object containing the entire `logs` tree including a time profiling between each log.
214
+ | ***context*** | The `context` in which this log bundle was created, containing information such as api path, method..
215
+ | ***context.tags*** | The `tags` created in this context
216
+ | ***req*** | The body of the `request` that originated this bundle
217
+ | ***res*** | If it is a complete request context here you will be able to see the `response` of that request
214
218
 
215
- The generated bundle follows the following structure, where the `logs` array can contain more log nodes like the example
219
+ The generated logs tree follows the following structure, where the `logs` array can contain more log nodes like the example
216
220
 
217
221
  ```ts
218
222
  {
@@ -261,10 +265,10 @@ There are some methods available for use in NestLoggerService, here is a list of
261
265
  fatal(...args)
262
266
  ```
263
267
 
264
- Where all log levels follow the same argument model, there are thre call combinations, here is an example with `log()` level
268
+ Where all log levels follow the same argument model, there are three call combinations, here is an example with `log()` level
265
269
 
266
270
  ```ts
267
- // The first way is sending a text that can contain special characters for formatting and then the arguments referring to the formatting.
271
+ // The first way is sending a text that can contain special characters of printf-like format for formatting (see https://github.com/pinojs/quick-format-unescaped), then the next arguments are the values ​​referring to the provided formatting..
268
272
  this.logService.log("message to format %d %d", 10, 20)
269
273
 
270
274
  // The second form precedes an object that will be merged together with the formatted message
@@ -280,9 +284,9 @@ There are some methods available for use in NestLoggerService, here is a list of
280
284
 
281
285
  | Method | Description
282
286
  | :--- | :----:
283
- | `enter(`branchName`)` | This method creates a node in the log tree where the '`branchName`' is an string that will be the name of the subtree of logs
284
- | `exit()` | This method closes the current subtree, remembering that the same amount opened with `enter()` must be closed with `exit()`
285
- | `putTag(`tagName, tagValue`)` | Where the '`tagName`' and '`tagValue`' are strings. This method adds a tag in the current context, the tags have no direct relation with the `enter()` and `exit()` methods, so regardless of the current state of the tree, the tags will be added separately in the bundle.
287
+ | ***enter(`branchName`)*** | This method creates a node in the log tree where the '`branchName`' is an string that will be the name of the subtree of logs
288
+ | ***exit()*** | This method closes the current subtree, remembering that the same amount opened with `enter()` must be closed with `exit()`
289
+ | ***putTag(`tagName, tagValue`)*** | Where the '`tagName`' and '`tagValue`' are strings. This method adds a tag in the current context, the tags have no direct relation with the `enter()` and `exit()` methods, so regardless of the current state of the tree, the tags will be added separately in the bundle.
286
290
 
287
291
  - Async Methods
288
292
 
@@ -290,7 +294,7 @@ There are some methods available for use in NestLoggerService, here is a list of
290
294
 
291
295
  | Method | Description
292
296
  | :--- | :----:
293
- | `createAsyncLogger()` | Creates an asynchronous LoggerBundle, where the responsibility for transporting the bundle is on your side
297
+ | ***createAsyncLogger()*** | Creates an asynchronous LoggerBundle, where the responsibility for transporting the bundle is on your side
294
298
 
295
299
  ______
296
300
 
@@ -322,18 +326,22 @@ ______
322
326
  })
323
327
  ```
324
328
 
325
- You must provide the desired parameters for the LoggerBundle, the parameters follow the following schema
329
+ You must provide the desired parameters for the LoggerBundleModule, the parameters follow the following schema
326
330
 
327
331
  ```ts
328
332
  // default config
329
333
  {
330
- pinoStream: {
334
+ loggers: {
331
335
  type: 'default',
332
336
  prettyPrint: {
337
+ mode: NestLoggerParamsLogggerMode, // DEFAULT IS LOG_BUNDLE
333
338
  disabled: boolean,
334
339
  options: pino.PrettyOptions,
335
340
  },
336
- streams: pinoms.Streams,
341
+ streams: {
342
+ mode: NestLoggerParamsLogggerMode, // DEFAULT IS LOG_BUNDLE
343
+ pinoStreams: pinoms.Streams
344
+ },
337
345
  timestamp: {
338
346
  format: {
339
347
  template: string,
@@ -345,9 +353,7 @@ You must provide the desired parameters for the LoggerBundle, the parameters fol
345
353
  // You can change this
346
354
  contextBundle: {
347
355
  strategy: {
348
- onDispatch: NestLoggerDispatchStrategy,
349
- level: NestLoggerLevelStrategy,
350
- onError: NestLoggerOnErrorStrategy,
356
+ level: NestLoggerLevelStrategy
351
357
  },
352
358
  }
353
359
  }
@@ -355,17 +361,18 @@ You must provide the desired parameters for the LoggerBundle, the parameters fol
355
361
  ```ts
356
362
  // custom config
357
363
  {
358
- pinoStream: {
364
+ loggers: {
359
365
  type: 'custom',
360
- logger: pino.Logger
366
+ logger: pino.Logger,
367
+ level?: string,
368
+ bundleLogger: pino.Logger
369
+ lineLogger?: pino.Logger
361
370
  },
362
371
 
363
372
  // You can change this
364
373
  contextBundle: {
365
374
  strategy: {
366
- onDispatch: NestLoggerDispatchStrategy,
367
- level: NestLoggerLevelStrategy,
368
- onError: NestLoggerOnErrorStrategy,
375
+ level: NestLoggerLevelStrategy
369
376
  },
370
377
  }
371
378
  }
@@ -377,77 +384,118 @@ Below is the description of each parameter
377
384
 
378
385
  | Param | Description
379
386
  | :--- | :----:
380
- | `pinoStream`: NestLoggerParamsPinoStream \| NestLoggerParamsCustomPino | The NestLoggerBundle uses the `pino-multi-stream ` to transport the logs to several different destinations at the same time, for that it is necessary to use the `type: 'default'` so some parameters of `NestLoggerParamsPinoStream` will be provided, but if you choose to use a `type: 'custom'` some parameters of `NestLoggerParamsCustomPino` will be provided and you can use a pin logger configured in your own way.
381
- | `contextBundle`: NestLoggerParamsContextBundle | Here you can configure some behaviors related to how the bundle is created, for example, configure what the bundle's marjoritary level will be..
387
+ | ***loggers***?: NestLoggerParamsPinoStream \| NestLoggerParamsCustomPino | The NestLoggerBundle uses the `pino-multi-stream ` to transport the logs to several different destinations at the same time, if you want to use the default implementation that makes managing these logs very easy use type `'default'` so some parameters of `NestLoggersParamsStream` will be provided, but if you choose to use a type `'custom'` some parameters of `NestLoggersParamsCustom` will be provided and you can use a `pino` logger configured in your own way.
388
+ | ***contextBundle***?: NestLoggerParamsContextBundle | Here you can configure some behaviors related to how the bundle is created, for example, configure what the bundle's marjoritary level will be..
389
+ | ***forRoutes***?: (string \| Type<any> \| RouteInfo)[] | Pattern based routes are supported as well. For instance, the asterisk is used as a wildcard, and will match any combination of characters, for more datails see [NestJS-Middlewares](https://docs.nestjs.com/middleware), the default is `[{ path: '*', method: RequestMethod.ALL }]`
382
390
 
383
- - **NestLoggerParamsPinoStream**<br/>
391
+ - **NestLoggersParamsStream**<br/>
384
392
  If you choose to use the default configuration in `NestLoggerParams`, using '`{ type: 'default', ... }`' the options for these parameters will be provided
385
393
  > It is worth remembering that it is recommended to use this configuration if you do not have the need to create your own configuration.
386
394
 
387
395
  | Param | Description
388
396
  | :--- | :----:
389
- | `type: 'default'` | For the options to follow this pattern you must set the type to `'default'`
390
- | `prettyPrint`: NestLoggerParamsPrettyStream | Here you can configure `prettyStream`, choosing to disable it if necessary and also provide your `pin.PrettyOptions`
391
- | `streams`: pinoms.Streams | You can also tell which streams you want pinoms handles, you can find implementations of various transporters that can be used here https://github.com/pinojs/pino/blob/master/docs/transports.md#legacy
392
- | `timestamp`: NestLoggerParamsPinoTimestamp | You can also configure how the timestamp will be formatted in the logs informing a template and a timezone, the template is created with the help of `dayjs` to assemble the desired string you can use the symbols informed here https://day.js.org/docs/en/display/format
397
+ | ***type***: `'default'` | For the options to follow this pattern you must set the type to `'default'`
398
+ | ***prettyPrint***?: NestLoggersParamsPretty | Here you can configure `prettyStream`, choosing to disable it if necessary and also provide your `pin.PrettyOptions`
399
+ | ***streams***?: NestLoggersParamsStreams | Here you can configure `streams`, choosing to disable it if necessary and also provide your own transporter
400
+ | ***timestamp***?: NestLoggerParamsPinoTimestamp | You can also configure how the timestamp will be formatted in the logs informing a template and a timezone, the template is created with the help of `dayjs` to assemble the desired string you can use the symbols informed here [Day.js](https://day.js.org/docs/en/display/format)
393
401
 
394
- - **NestLoggerParamsPrettyStream**<br/>
402
+ ### Related Params
403
+
404
+ - **NestLoggersParamsPretty**<br/>
395
405
 
396
406
  | Param | Description
397
407
  | :--- | :----:
398
- | `disabled`: boolean | If you want to disable the `prettyStream` you can pass `false` in this option `(remembering that, as it will be disabled the 'options' will not have any effects)`
399
- | `options`: pino.PrettyOptions | Here you can pass some options provided by `pin`, like `{colorize: true}`
408
+ | ***mode***?: NestLoggerParamsLogggerMode | Here you can choose the mode that `prettyStream` will display the logs, the default value is `NestLoggerParamsLogggerMode.LOG_BUNDLE`, so the bundle will be logged.
409
+ | ***disabled***?: boolean | If you want to disable the `prettyStream` you can pass `false` in this option `(remembering that, as it will be disabled the 'options' will not have any effects)`
410
+ | ***options***?: pino.PrettyOptions | Here you can pass some options provided by `pin`, like `{colorize: true}`
400
411
 
401
- - **pinoms.Streams**<br/>
412
+ - **NestLoggersParamsStreams**<br/>
413
+
414
+ | Param | Description
415
+ | :--- | :----:
416
+ | ***mode***?: NestLoggerParamsLogggerMode | Here you can choose the mode that `streams` will display the logs, the default value is `NestLoggerParamsLogggerMode.LOG_BUNDLE`, so the bundle will be logged.
417
+ | ***pinoStreams***?: pinoms.Streams | You can also tell which `streams` you want pinoms handles, you can find implementations of various transporters that can be used here https://github.com/pinojs/pino/blob/master/docs/transports.md#legacy
402
418
 
403
- Here is an example of how to use a transport `(In this example, datadog is used)`
404
- > To find more transporters, have a look at the pino repository in this section [Legacy](https://github.com/pinojs/pino/blob/master/docs/transports.md#legacy)
405
-
406
- ```ts
407
- import datadog from 'pino-datadog';
408
-
409
- // ...
410
- NestLoggerModule.forRootAsync({
411
- useFactory: async (config: ConfigService): Promise<NestLoggerParams> => {
412
- const datadogStream = await datadog.createWriteStream({
413
- apiKey: config.get('datadog.apiKey'),
414
- service: config.get('datadog.serviceName'),
415
- });
416
-
417
- return {
418
- // ...
419
- pinoStream: {
420
- type: 'default',
421
- streams: [
422
- {
423
- stream: datadogStream,
424
- },
425
- ],
426
- },
427
- };
428
- },
429
- inject: [ConfigService],
430
- }),
419
+ - **NestLoggerParamsLogggerMode**<br/>
420
+
421
+ There are two types of modes used in the `prettyPrint` and `streams` settings, they are:
422
+
423
+ | Enum | Description
424
+ | :--- | :----:
425
+ | ***NestLoggerParamsLogggerMode.LOG_BUNDLE*** | Indicates that the log will be sent to the destination as a bundle `(this is the default behavior of all destinations)`
426
+ | ***NestLoggerParamsLogggerMode.LOG_LINE*** | Indicates that the log will be sent to the destination as log lines
427
+
428
+ - **pinoms.Streams**<br/>
431
429
 
432
- ```
430
+ Here you can set some streams to transport your logs, check these examples of how to use [Streams](#streams)
433
431
 
434
432
  - **NestLoggerParamsPinoTimestamp**<br/>
435
433
 
436
434
  | Param | Description
437
435
  | :--- | :----:
438
- | `template`: string | To format the timezone your way, use a string that follows the pattern informed here [dayjs-formar](https://day.js.org/docs/en/display/format), eg: `'DD/MM/YYYY - HH:mm:ss.SSS'`
439
- | `timezone`: string | Inform the timezone, you can find the valid timezones here [IANA database](https://www.iana.org/time-zones)
436
+ | ***template***: string | To format the timezone your way, use a string that follows the pattern informed here [dayjs-formar](https://day.js.org/docs/en/display/format), eg: `'DD/MM/YYYY - HH:mm:ss.SSS'`
437
+ | ***timezone***: string | Inform the timezone, you can find the valid timezones here [IANA database](https://www.iana.org/time-zones)
440
438
 
441
439
 
442
440
 
443
- - **NestLoggerParamsCustomPino**<br/>
441
+ - **NestLoggersParamsCustom**<br/>
444
442
  But if you choose to use the default configuration in `NestLoggerParamsCustomPino`, using '`{ type: 'custom', ... }`' the options for these parameters will be provided
445
443
 
446
444
  | Param | Description
447
445
  | :--- | :----:
448
- | `type: 'custom'` | For the options to follow this pattern you must set the type to `'custom'`
449
- | `logger`: pino.Logger | You can pass a logger that was configured your way
446
+ | ***type***: `'custom'` | For the options to follow this pattern you must set the type to `'custom'`
447
+ | ***bundleLogger***: pino.Logger | This logger will be used to log bundles only
448
+ | ***lineLogger***?: pino.Logger | This logger will be used to log only line logs (which are common logs)
449
+
450
+ - **NestLoggerParamsContextBundle**<br/>
451
+ Here you can configure bundle-related behaviors, such as the `strategy` used to dispatch the bundle to the loggers
452
+
453
+ | Param | Description
454
+ | :--- | :----:
455
+ | ***strategy***?: NestLoggerParamsContextBundleStrategy | Strategy used to dispatch the bundle to the loggers
456
+
457
+ ### Related Params
458
+
459
+ - **NestLoggerParamsContextBundleStrategy**<br/>
460
+ Below are the settings available for these strategies
450
461
 
462
+ | Param | Description
463
+ | :--- | :----:
464
+ | ***level***?: NestLoggerLevelStrategy | This strategy defines what will be the main level of the bundle, as the bundle will contain a tree of logs, it can contain several logs with several levels, so to define the main level, the configuration provided here is used to decide the best level, the default strategy is `NestLoggerLevelStrategy.MAJOR_LEVEL`
465
+
466
+ ### Streams
467
+
468
+ Probably at some point you may need to transport your logs, for example to some
469
+ observability service in the cloud, here is an example of how to configure this using the `streams` parameter to send the logs to Datadog service `(In this example, datadog transporter is used)`
470
+ > To find more transporters and how to install their dependencies, have a look at the pino repository in this section [Legacy](https://github.com/pinojs/pino/blob/master/docs/transports.md#legacy)
471
+
472
+ ```ts
473
+ import datadog from 'pino-datadog';
474
+
475
+ // ...
476
+ NestLoggerModule.forRootAsync({
477
+ useFactory: async (config: ConfigService): Promise<NestLoggerParams> => {
478
+ const datadogStream = await datadog.createWriteStream({
479
+ apiKey: config.get('datadog.apiKey'),
480
+ service: config.get('datadog.serviceName'),
481
+ });
482
+
483
+ return {
484
+ // ...
485
+ pinoStream: {
486
+ type: 'default',
487
+ streams: [
488
+ {
489
+ stream: datadogStream,
490
+ },
491
+ ],
492
+ },
493
+ };
494
+ },
495
+ inject: [ConfigService],
496
+ }),
497
+
498
+ ```
451
499
 
452
500
  ### Custom Filter and Interceptor
453
501
 
@@ -457,7 +505,7 @@ If your application is already using a global/ interceptor scope filter, then yo
457
505
  // example-global-exception-filter.ts
458
506
 
459
507
  import { ArgumentsHost, Catch } from '@nestjs/common';
460
- import { LoggerExceptionFilter } from '@pedrohcd/nest-logger';
508
+ import { LoggerExceptionFilter } from 'nest-logger-bundle';
461
509
 
462
510
  @Catch()
463
511
  export class GlobalExceptionFilter extends LoggerExceptionFilter {
@@ -473,7 +521,7 @@ export class GlobalExceptionFilter extends LoggerExceptionFilter {
473
521
  // example-http-interceptor.ts
474
522
 
475
523
  import { CallHandler, Catch, ExecutionContext } from '@nestjs/common';
476
- import { LoggerHttpInterceptor } from '@pedrohcd/nest-logger';
524
+ import { LoggerHttpInterceptor } from 'nest-logger-bundle';
477
525
  import { Observable } from 'rxjs';
478
526
 
479
527
  @Injectable()
@@ -517,7 +565,7 @@ import { GlobalInterceptor } from './example-http-interceptor.ts'
517
565
  In case you need to call some asynchronous function and not block the execution with `await` this can create a point of failure for the `LoggerBundle`, this failure is not serious but it can create confusion when interpreting the logs, this happens because a request that originated this call can end before the async function finishes, so when the request is finished the `LoggerBundle` assembles a bundle and transports it, so the async call that can still be loose and calling logging in will not be packaged in the same bundle, these logs they would be lost. For this there is a function that creates an asynchronous `LoggerBundle` and transfers you the responsibility of transporting the log at the end of the asynchronous flow. An example of usage is shown below
518
566
 
519
567
  ```ts
520
- import { AsyncLoggerService, NestLoggerService } from '@pedrohcd/nest-logger';
568
+ import { AsyncLoggerService, NestLoggerService } from 'nest-logger-bundle';
521
569
 
522
570
  @Injectable()
523
571
  export class SampleUserService {
@@ -556,8 +604,8 @@ export class SampleUserService {
556
604
 
557
605
  ## Stay in touch
558
606
 
559
- - Author - [Pedro Henrique C.](https://github.com/pedrohcdo)
607
+ - Author - [Pedro Henrique C.](https://twitter.com/pedrohcdo)
560
608
 
561
609
  ## License
562
610
 
563
- NestLoggerBundle is [MIT licensed](LICENSE).
611
+ NestLoggerBundle is [Apache License 2.0](LICENSE).
@@ -3,17 +3,17 @@ import pino from 'pino';
3
3
  import { NestLoggerParams } from '../../nest-logger.params';
4
4
  export declare class NestAsyncLoggerContext {
5
5
  private params;
6
- private streamLogger;
6
+ private bundleLogger;
7
7
  private moduleRef;
8
8
  private detachedContext;
9
- constructor(params: NestLoggerParams, streamLogger: pino.Logger, moduleRef: ModuleRef);
9
+ constructor(params: NestLoggerParams, bundleLogger: pino.Logger, moduleRef: ModuleRef);
10
10
  getCurrent(): {
11
11
  logger: import("pino").Logger<import("pino").LoggerOptions>;
12
12
  reqId: any;
13
13
  loggerBundle: any;
14
14
  };
15
15
  dispatchCurrentLoggerBundle(message: string): void;
16
- dispatchCurrentLoggerBundle(innerObject: unknown, message?: string): void;
16
+ dispatchCurrentLoggerBundle(exception: unknown, message?: string): void;
17
17
  hasContext(): boolean;
18
18
  createDetachedContext(): Promise<NestAsyncLoggerContext>;
19
19
  }
@@ -25,9 +25,9 @@ const nest_logger_params_1 = require("../../nest-logger.params");
25
25
  const logger_bundle_service_1 = require("../logger-bundle.service");
26
26
  const async_logger_hook_1 = require("./async-logger.hook");
27
27
  let NestAsyncLoggerContext = NestAsyncLoggerContext_1 = class NestAsyncLoggerContext {
28
- constructor(params, streamLogger, moduleRef) {
28
+ constructor(params, bundleLogger, moduleRef) {
29
29
  this.params = params;
30
- this.streamLogger = streamLogger;
30
+ this.bundleLogger = bundleLogger;
31
31
  this.moduleRef = moduleRef;
32
32
  }
33
33
  getCurrent() {
@@ -43,21 +43,18 @@ let NestAsyncLoggerContext = NestAsyncLoggerContext_1 = class NestAsyncLoggerCon
43
43
  loggerBundle: fromStore.loggerContext,
44
44
  };
45
45
  }
46
- dispatchCurrentLoggerBundle(innerObject, message) {
47
- var _a, _b, _c;
46
+ dispatchCurrentLoggerBundle(exceptionOrMessage, message) {
48
47
  if (!this.hasContext()) {
49
48
  return;
50
49
  }
51
50
  const { logger, loggerBundle } = this.getCurrent();
52
- if (((_c = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.contextBundle) === null || _b === void 0 ? void 0 : _b.strategy) === null || _c === void 0 ? void 0 : _c.onDispatch) === nest_logger_params_1.NestLoggerDispatchStrategy.DISPATCH) {
53
- const { object, level } = loggerBundle.build();
54
- const childLogger = logger.child(object);
55
- if (message)
56
- childLogger[level](innerObject, message);
57
- else
58
- childLogger[level](innerObject);
59
- childLogger.flush();
60
- }
51
+ const { object, level } = loggerBundle.build();
52
+ const childLogger = logger.child(object);
53
+ if (message)
54
+ childLogger[level](exceptionOrMessage, message);
55
+ else
56
+ childLogger[level](exceptionOrMessage);
57
+ childLogger.flush();
61
58
  loggerBundle.expireNow();
62
59
  }
63
60
  hasContext() {
@@ -75,7 +72,7 @@ let NestAsyncLoggerContext = NestAsyncLoggerContext_1 = class NestAsyncLoggerCon
75
72
  }
76
73
  else {
77
74
  getFrom = {
78
- logger: this.streamLogger,
75
+ logger: this.bundleLogger,
79
76
  loggerBundle: null,
80
77
  reqId: '<unknown>',
81
78
  };
@@ -94,7 +91,7 @@ let NestAsyncLoggerContext = NestAsyncLoggerContext_1 = class NestAsyncLoggerCon
94
91
  NestAsyncLoggerContext = NestAsyncLoggerContext_1 = __decorate([
95
92
  (0, common_1.Injectable)({}),
96
93
  __param(0, (0, common_1.Inject)(nest_logger_module_definition_1.MODULE_OPTIONS_TOKEN)),
97
- __param(1, (0, common_1.Inject)(nest_logger_params_1.PINO_LOGGER_PROVIDER_TOKEN)),
94
+ __param(1, (0, common_1.Inject)(nest_logger_params_1.BUNDLE_LOGGER_PROVIDER_TOKEN)),
98
95
  __metadata("design:paramtypes", [Object, Object, core_1.ModuleRef])
99
96
  ], NestAsyncLoggerContext);
100
97
  exports.NestAsyncLoggerContext = NestAsyncLoggerContext;
@@ -1 +1 @@
1
- {"version":3,"file":"async-logger-context.service.js","sourceRoot":"","sources":["../../../../lib/src/bundle/context/async-logger-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,uCAAyC;AACzC,gDAAwB;AACxB,uFAA2E;AAC3E,iEAIkC;AAClC,oEAA4D;AAC5D,2DAAwD;AAMxD,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IAQlC,YACuC,MAAwB,EAClB,YAAyB,EAC7D,SAAoB;QAFU,WAAM,GAAN,MAAM,CAAkB;QAClB,iBAAY,GAAZ,YAAY,CAAa;QAC7D,cAAS,GAAT,SAAS,CAAW;IAC1B,CAAC;IAEJ,UAAU;QACT,IAAI,IAAI,CAAC,eAAe;YAAE,OAAO,IAAI,CAAC,eAAe,CAAC;QAEtD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC;SACZ;QAED,MAAM,SAAS,GAAG,qCAAiB,CAAC,QAAQ,EAAE,CAAC;QAE/C,OAAO;YACN,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,YAAY,EAAE,SAAS,CAAC,aAAa;SACr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,MAAM,EAAE,IAAI,CAAC,YAAY;gBACzB,YAAY,EAAE,IAAI;gBAClB,KAAK,EAAE,WAAW;aAClB,CAAC;SACF;QAED,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAEhD,IAAI,YAAY;YAAE,oBAAoB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE9D,OAAO,CAAC,eAAe,GAAG;YACzB,MAAM;YACN,YAAY,EAAE,oBAAoB;YAClC,KAAK;SACL,CAAC;QAEF,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAA;AAhGY,sBAAsB;IADlC,IAAA,mBAAU,EAAC,EAAE,CAAC;IAUZ,WAAA,IAAA,eAAM,EAAC,oDAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,eAAM,EAAC,+CAA0B,CAAC,CAAA;qDAChB,gBAAS;GAXjB,sBAAsB,CAgGlC;AAhGY,wDAAsB"}
1
+ {"version":3,"file":"async-logger-context.service.js","sourceRoot":"","sources":["../../../../lib/src/bundle/context/async-logger-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,uCAAyC;AACzC,gDAAwB;AACxB,uFAA2E;AAC3E,iEAGkC;AAClC,oEAA4D;AAC5D,2DAAwD;AAMxD,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IAQlC,YACuC,MAAwB,EAChB,YAAyB,EAC/D,SAAoB;QAFU,WAAM,GAAN,MAAM,CAAkB;QAChB,iBAAY,GAAZ,YAAY,CAAa;QAC/D,cAAS,GAAT,SAAS,CAAW;IAC1B,CAAC;IAEJ,UAAU;QACT,IAAI,IAAI,CAAC,eAAe;YAAE,OAAO,IAAI,CAAC,eAAe,CAAC;QAEtD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC;SACZ;QAED,MAAM,SAAS,GAAG,qCAAiB,CAAC,QAAQ,EAAE,CAAC;QAE/C,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IAAI,CAAC,YAAY;gBACzB,YAAY,EAAE,IAAI;gBAClB,KAAK,EAAE,WAAW;aAClB,CAAC;SACF;QAED,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAEhD,IAAI,YAAY;YAAE,oBAAoB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE9D,OAAO,CAAC,eAAe,GAAG;YACzB,MAAM;YACN,YAAY,EAAE,oBAAoB;YAClC,KAAK;SACL,CAAC;QAEF,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAA;AA/FY,sBAAsB;IADlC,IAAA,mBAAU,EAAC,EAAE,CAAC;IAUZ,WAAA,IAAA,eAAM,EAAC,oDAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,eAAM,EAAC,iDAA4B,CAAC,CAAA;qDAClB,gBAAS;GAXjB,sBAAsB,CA+FlC;AA/FY,wDAAsB"}
@@ -70,8 +70,8 @@ let NestLoggerBundle = class NestLoggerBundle {
70
70
  const bindings = {
71
71
  context: Object.assign({
72
72
  requestDuration: this.currentBranch.profiling(),
73
+ tags: Object.assign({}, this.bindings.tags),
73
74
  }, this.bindings.context),
74
- tags: Object.assign({}, this.bindings.tags),
75
75
  };
76
76
  delete bindings.context.response;
77
77
  if (this.bindings.context.response) {
@@ -1 +1 @@
1
- {"version":3,"file":"logger-bundle.service.js","sourceRoot":"","sources":["../../../lib/src/bundle/logger-bundle.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2D;AAC3D,8DAAkF;AAElF,oFAAwE;AAExE,iEAA6D;AAsB7D,MAAa,oBAAoB;CAGhC;AAHD,oDAGC;AAQD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAK5B,YAAkD,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;QAJlE,YAAO,GAAY,KAAK,CAAC;QAKhC,IAAI,CAAC,aAAa,GAAG,IAAI,4BAAY,CAAC,IAAI,EAAE,MAAM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AC,OAAO,CACrB;SACD,CAAC;QACF,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE;YACnC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACvB,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;aACnC,CAAC,CAAC;SACH;QAGD,MAAM,MAAM,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;YACnC,GAAG,QAAQ;SACX,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAC/C,CAAA,MAAA,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,aAAa,0CAAE,QAAQ,0CAAE,KAAK,KAAI,4CAAuB,CAAC,WAAW,EAClF,CAAA,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,aAAa,0CAAE,YAAY,KAAI,MAAM,CAClD,CAAC;QAGF,OAAO;YACN,MAAM;YACN,KAAK;SACL,CAAC;IACH,CAAC;IAED,SAAS;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,SAAS;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;CACD,CAAA;AArGY,gBAAgB;IAH5B,IAAA,mBAAU,EAAC;QACX,KAAK,EAAE,cAAK,CAAC,OAAO;KACpB,CAAC;IAMY,WAAA,IAAA,eAAM,EAAC,oDAAoB,CAAC,CAAA;;GAL7B,gBAAgB,CAqG5B;AArGY,4CAAgB"}
@@ -1,4 +1,5 @@
1
1
  export * from './filters/logger-exception.filter';
2
2
  export * from './filters/logger-http.interceptor';
3
3
  export * from './middleware/bind-logger.middleware';
4
- export * from './providers/pino-logger.provider';
4
+ export * from './providers/bundle-logger.provider';
5
+ export * from './providers/pretty-logger.provider';
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./filters/logger-exception.filter"), exports);
18
18
  __exportStar(require("./filters/logger-http.interceptor"), exports);
19
19
  __exportStar(require("./middleware/bind-logger.middleware"), exports);
20
- __exportStar(require("./providers/pino-logger.provider"), exports);
20
+ __exportStar(require("./providers/bundle-logger.provider"), exports);
21
+ __exportStar(require("./providers/pretty-logger.provider"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,oEAAkD;AAElD,sEAAoD;AAEpD,mEAAiD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,oEAAkD;AAElD,sEAAoD;AAEpD,qEAAmD;AACnD,qEAAmD"}
@@ -0,0 +1,2 @@
1
+ import { Provider } from '@nestjs/common';
2
+ export declare const BundleLoggerProvider: Provider;