nestjs-pino 2.5.1 → 2.5.2-alpha.705f0b
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/README.md +16 -7
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -296,11 +296,11 @@ class ConfigModule {}
|
|
|
296
296
|
class TestModule {}
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
-
###
|
|
299
|
+
### Asynchronous logging
|
|
300
300
|
|
|
301
|
-
> In essence,
|
|
301
|
+
> In essence, asynchronous logging enables even faster performance by `pino`.
|
|
302
302
|
|
|
303
|
-
Please, read [pino
|
|
303
|
+
Please, read [pino asynchronous mode docs](https://github.com/pinojs/pino/blob/master/docs/asynchronous.md) first. There is a possibility of the most recently buffered log messages being lost in case of a system failure, e.g. a power cut.
|
|
304
304
|
|
|
305
305
|
If you know what you're doing, you can enable it like so:
|
|
306
306
|
|
|
@@ -308,16 +308,25 @@ If you know what you're doing, you can enable it like so:
|
|
|
308
308
|
import pino from 'pino';
|
|
309
309
|
import { LoggerModule } from 'nestjs-pino';
|
|
310
310
|
|
|
311
|
-
const dest = pino.extreme();
|
|
312
|
-
const logger = pino(dest);
|
|
313
|
-
|
|
314
311
|
@Module({
|
|
315
|
-
imports: [
|
|
312
|
+
imports: [
|
|
313
|
+
LoggerModule.forRoot({
|
|
314
|
+
pinoHttp: {
|
|
315
|
+
stream: pino.destination({
|
|
316
|
+
dest: './my-file', // omit for stdout
|
|
317
|
+
minLength: 4096, // Buffer before writing
|
|
318
|
+
sync: false, // Asynchronous logging
|
|
319
|
+
}),
|
|
320
|
+
},
|
|
321
|
+
}),
|
|
322
|
+
],
|
|
316
323
|
...
|
|
317
324
|
})
|
|
318
325
|
class MyModule {}
|
|
319
326
|
```
|
|
320
327
|
|
|
328
|
+
See [pino.destination](https://github.com/pinojs/pino/blob/master/docs/api.md#pino-destination)
|
|
329
|
+
|
|
321
330
|
## Testing a class that uses @InjectPinoLogger
|
|
322
331
|
|
|
323
332
|
This package exposes a `getLoggerToken()` function that returns a prepared injection token based on the provided context.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-pino",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2-alpha.705f0b",
|
|
4
4
|
"description": "Pino logger for NestJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"testEnvironment": "node"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"pino-http": "^6.4.0"
|
|
90
|
+
"pino-http": "^6.4.0",
|
|
91
|
+
"@nestjs/common": "^8.0.0"
|
|
91
92
|
}
|
|
92
93
|
}
|