@oneminutelogs/nestjs 1.0.0 → 1.0.1

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.
@@ -42,6 +42,9 @@ let OneMinuteLogsInterceptor = class OneMinuteLogsInterceptor {
42
42
  }));
43
43
  }
44
44
  logRequest(method, url, statusCode, duration, ip, userAgent, errorMessage) {
45
+ if (this.oml.config.autoLogRequests === false) {
46
+ return;
47
+ }
45
48
  const isError = statusCode >= 400;
46
49
  const logMethod = isError ? this.oml.error.bind(this.oml) : this.oml.info.bind(this.oml);
47
50
  logMethod({
@@ -1,7 +1,7 @@
1
1
  import { LoggerConfig, LogPayload } from "./types/index.js";
2
2
  export declare const OML_CONFIG = "OML_CONFIG";
3
3
  export declare class OneMinuteLogsService {
4
- private config;
4
+ readonly config: LoggerConfig;
5
5
  private logger;
6
6
  constructor(config: LoggerConfig);
7
7
  /**
@@ -7,6 +7,7 @@ export interface LoggerConfig {
7
7
  apiKey: string;
8
8
  appName?: string;
9
9
  environment?: string;
10
+ autoLogRequests?: boolean;
10
11
  }
11
12
  export interface LogPayload {
12
13
  type: LogType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneminutelogs/nestjs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "NestJS SDK for OneMinuteLogs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "git+https://github.com/One-Minute-Stack/oneminutelogs-nestjs.git"
23
+ "url": "git+https://github.com/One-Minute-Stack/oneminutelogs-nest.git"
24
24
  },
25
25
  "keywords": [
26
26
  "logging",
@@ -33,7 +33,7 @@
33
33
  "author": "OneMinute Stack",
34
34
  "license": "ISC",
35
35
  "bugs": {
36
- "url": "https://github.com/One-Minute-Stack/oneminutelogs-nestjs/issues"
36
+ "url": "https://github.com/One-Minute-Stack/oneminutelogs-nest/issues"
37
37
  },
38
38
  "homepage": "https://oneminutelogs.com/docs/nestjs",
39
39
  "peerDependencies": {