Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-logger-service

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-logger-service - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

dist/CustomContextBuilder.interface.d.ts

3

package.json
{
"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}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc