@infineit/winston-logger 1.0.26 → 1.0.27
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 +6 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,17 +39,6 @@ That implements a production-ready system advanced or basic Microservices or Mon
|
|
|
39
39
|
yarn add @infineit/winston-logger
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
### Basic Setup
|
|
46
|
-
|
|
47
|
-
To use `@infineit/winston-logger` in your NestJS application, simply import it of your `main.ts` file:
|
|
48
|
-
|
|
49
|
-
```sh
|
|
50
|
-
import { NestjsLoggerServiceAdapter } from '@infineit/winston-logger';;
|
|
51
|
-
```
|
|
52
|
-
|
|
53
42
|
### Prerequisites
|
|
54
43
|
|
|
55
44
|
- NestJS
|
|
@@ -57,14 +46,15 @@ That implements a production-ready system advanced or basic Microservices or Mon
|
|
|
57
46
|
- morgon
|
|
58
47
|
- prisma
|
|
59
48
|
|
|
60
|
-
|
|
61
49
|
### Getting Started
|
|
62
50
|
|
|
63
51
|
Follow these steps to set up and run logger. If all steps are followed correctly, logger should start without any issues:
|
|
64
52
|
|
|
65
|
-
1. use logger
|
|
53
|
+
1. To use `@infineit/winston-logger` in your NestJS application, simply import it of your `main.ts` file:
|
|
66
54
|
|
|
67
55
|
```bash
|
|
56
|
+
import { NestjsLoggerServiceAdapter } from '@infineit/winston-logger';;
|
|
57
|
+
|
|
68
58
|
const app = await NestFactory.create(AppModule, {bufferLogs: true });
|
|
69
59
|
|
|
70
60
|
app.useLogger(app.get(NestjsLoggerServiceAdapter));
|
|
@@ -114,7 +104,7 @@ You can configure the Logger using environment variables in your `.env` file:
|
|
|
114
104
|
- `LOGGER_DURATION_LOG_LEVEL`: Default log level warn,error,fatal for production or testing, It will calculate duration for request.
|
|
115
105
|
- `LOGGER_CONSOLE_PRINT`: True/False. Default False for production or testing.
|
|
116
106
|
- `LOGGER_LOG_IN_FILE`: True/False. Default False for production or testing.
|
|
117
|
-
- `LOGGER_SLACK_INC_WEBHOOK_URL`: Slack url, eg. https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX
|
|
107
|
+
- `LOGGER_SLACK_INC_WEBHOOK_URL`: Slack url, eg. `https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX`.
|
|
118
108
|
|
|
119
109
|
## Project structure
|
|
120
110
|
|
|
@@ -164,13 +154,8 @@ That class is injected with a Transient scope. By that, we can get the caller cl
|
|
|
164
154
|
This project is inspired by the excellent work from:
|
|
165
155
|
|
|
166
156
|
- [Medium](https://medium.com/@jose-luis-navarro/logging-on-nestjs-like-a-pro-with-correlation-ids-log-aggregation-winston-morgan-and-more-d03e3bb56772)
|
|
167
|
-
- [Logger
|
|
168
|
-
- [winston-pg
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
## Support
|
|
172
|
-
|
|
173
|
-
NestJS is an MIT-licensed open-source project that thrives with support from the community. If you’d like to contribute or sponsor, please [learn more here](https://docs.nestjs.com/support).
|
|
157
|
+
- [Logger](https://github.com/jnm733/nestjs-logger/tree/main)
|
|
158
|
+
- [winston-pg](https://github.com/InnovA2/winston-pg/tree/main)
|
|
174
159
|
|
|
175
160
|
## License
|
|
176
161
|
|