json-logger-service
Advanced tools
Comparing version 1.0.16 to 1.0.17
{ | ||
"name": "json-logger-service", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "Nest Json LoggerService implementation.", | ||
@@ -50,2 +50,3 @@ "main": "dist/index", | ||
"ts-jest": "~24.0.2", | ||
"ts-mockito": "2.5.0", | ||
"tslint": "~5.15.0", | ||
@@ -52,0 +53,0 @@ "tslint-config-airbnb": "~5.11.1", |
@@ -72,13 +72,27 @@ # json-logger-service | ||
An array of base paths you don't want to log (for security or GDPR reasons maybe) can be passed in the RequestLogger constructor. | ||
#### doNotLogPaths | ||
An array of base paths you do NOT want to log at all can be passed too. | ||
```typescript | ||
app.use(RequestLogger.buildExpressRequestLogger(['/my-path-with-sensible-information'])); | ||
app.use(RequestLogger.buildExpressRequestLogger({ doNotLogPaths: ['/health-server-status'] } as RequestLoggerOptions)); | ||
``` | ||
Then, considering a request to `/my-path-with-sensible-information/customerEmail@gmail.com`, the logger output should be something like: | ||
Then considering a request to `/health-server-status`, the logger will not log anything. | ||
#### logOnlyBasePaths | ||
An array of base paths you want to log without the full path (for security or GDPR reasons maybe) can be passed in the RequestLogger constructor. | ||
```typescript | ||
app.use(RequestLogger.buildExpressRequestLogger({ logOnlyBasePaths: ['/my-path'] } as RequestLoggerOptions)); | ||
``` | ||
Then, considering a request to `/my-path/customerEmail@gmail.com`, the logger output should be something like: | ||
```json | ||
{"name":"RequestLogger","hostname":"HOSTNAME","pid":PID,"level":30,"msg":"Before request GET 'Path Omitted'","time":"2019-12-09T12:10:23.020Z","v":0} | ||
{"name":"RequestLogger","hostname":"HOSTNAME","pid":PID,"level":30,"msg":"After request GET 'Path Omitted'","time":"2019-12-09T12:10:23.021Z","v":0} | ||
{"name":"RequestLogger","hostname":"HOSTNAME","pid":PID,"level":30,"msg":"Before request GET '/my-path'","time":"2019-12-09T12:10:23.020Z","v":0} | ||
{"name":"RequestLogger","hostname":"HOSTNAME","pid":PID,"level":30,"msg":"After request GET '/my-path'","time":"2019-12-09T12:10:23.021Z","v":0} | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98
1
20261
11
21
214
1