@wgtechlabs/log-engine 2.0.0 → 2.1.0
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/LICENSE +21 -21
- package/README.md +869 -608
- package/dist/formatter/data-formatter.d.ts +2 -1
- package/dist/formatter/data-formatter.d.ts.map +1 -1
- package/dist/formatter/data-formatter.js +1 -1
- package/dist/formatter/message-formatter.d.ts +23 -23
- package/dist/formatter/message-formatter.d.ts.map +1 -1
- package/dist/formatter/message-formatter.js +23 -23
- package/dist/formatter/timestamp.d.ts.map +1 -1
- package/dist/index.d.ts +130 -136
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -108
- package/dist/logger/advanced-outputs.d.ts +159 -0
- package/dist/logger/advanced-outputs.d.ts.map +1 -0
- package/dist/logger/advanced-outputs.js +586 -0
- package/dist/logger/config.d.ts +18 -18
- package/dist/logger/config.d.ts.map +1 -1
- package/dist/logger/config.js +32 -29
- package/dist/logger/core.d.ts +128 -84
- package/dist/logger/core.d.ts.map +1 -1
- package/dist/logger/core.js +259 -74
- package/dist/logger/environment.d.ts +15 -15
- package/dist/logger/environment.d.ts.map +1 -1
- package/dist/logger/environment.js +15 -15
- package/dist/logger/filtering.d.ts +16 -16
- package/dist/logger/filtering.d.ts.map +1 -1
- package/dist/logger/filtering.js +37 -22
- package/dist/redaction/config.d.ts +8 -8
- package/dist/redaction/config.d.ts.map +1 -1
- package/dist/redaction/config.js +8 -8
- package/dist/redaction/redactor.d.ts +60 -60
- package/dist/redaction/redactor.d.ts.map +1 -1
- package/dist/redaction/redactor.js +101 -96
- package/dist/types/index.d.ts +98 -16
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +80 -68
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Type definitions for the Log Engine library
|
|
3
3
|
* Provides strongly-typed interfaces for configuration and log levels
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Type for log data - accepts any value since logs can contain literally anything
|
|
7
|
+
* This is intentionally `any` rather than `unknown` for maximum usability in a logging context
|
|
8
|
+
*/
|
|
9
|
+
export type LogData = any;
|
|
5
10
|
/**
|
|
6
11
|
* Log levels representing message severity (lowest to highest)
|
|
7
12
|
* Used for filtering messages based on importance
|
|
@@ -48,6 +53,73 @@ export interface LogEntry {
|
|
|
48
53
|
/** The actual log message content */
|
|
49
54
|
message: string;
|
|
50
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Output handler function type for custom log output
|
|
58
|
+
* Receives the log level, formatted message, and optional data
|
|
59
|
+
*/
|
|
60
|
+
export type LogOutputHandler = (level: string, message: string, data?: LogData) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Built-in output handler types
|
|
63
|
+
*/
|
|
64
|
+
export type BuiltInOutputHandler = 'console' | 'silent' | 'file' | 'http';
|
|
65
|
+
/**
|
|
66
|
+
* Configuration for file output handler
|
|
67
|
+
*/
|
|
68
|
+
export interface FileOutputConfig {
|
|
69
|
+
/** File path to write logs to */
|
|
70
|
+
filePath: string;
|
|
71
|
+
/** Whether to append to existing file (default: true) */
|
|
72
|
+
append?: boolean;
|
|
73
|
+
/** Maximum file size before rotation in bytes (optional) */
|
|
74
|
+
maxFileSize?: number;
|
|
75
|
+
/** Number of backup files to keep during rotation (default: 3) */
|
|
76
|
+
maxBackupFiles?: number;
|
|
77
|
+
/** Custom format function for file output */
|
|
78
|
+
formatter?: (level: string, message: string, data?: LogData) => string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Configuration for HTTP output handler
|
|
82
|
+
*/
|
|
83
|
+
export interface HttpOutputConfig {
|
|
84
|
+
/** HTTP endpoint URL to send logs to */
|
|
85
|
+
url: string;
|
|
86
|
+
/** HTTP method (default: 'POST') */
|
|
87
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
88
|
+
/** Custom headers to include with requests */
|
|
89
|
+
headers?: Record<string, string>;
|
|
90
|
+
/** Batch size for sending multiple logs (default: 1) */
|
|
91
|
+
batchSize?: number;
|
|
92
|
+
/** Timeout for HTTP requests in ms (default: 5000) */
|
|
93
|
+
timeout?: number;
|
|
94
|
+
/** Custom format function for HTTP payload */
|
|
95
|
+
formatter?: (logs: Array<{
|
|
96
|
+
level: string;
|
|
97
|
+
message: string;
|
|
98
|
+
data?: LogData;
|
|
99
|
+
timestamp: string;
|
|
100
|
+
}>) => LogData;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Configuration object for advanced built-in handlers
|
|
104
|
+
*/
|
|
105
|
+
export interface AdvancedOutputConfig {
|
|
106
|
+
file?: FileOutputConfig;
|
|
107
|
+
http?: HttpOutputConfig;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Enhanced output target - can be built-in handler, custom function, or configured handler object
|
|
111
|
+
*/
|
|
112
|
+
export type EnhancedOutputTarget = BuiltInOutputHandler | LogOutputHandler | {
|
|
113
|
+
type: 'file';
|
|
114
|
+
config: FileOutputConfig;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'http';
|
|
117
|
+
config: HttpOutputConfig;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Output target - can be a built-in handler string or custom function
|
|
121
|
+
*/
|
|
122
|
+
export type OutputTarget = BuiltInOutputHandler | LogOutputHandler;
|
|
51
123
|
/**
|
|
52
124
|
* Configuration options for the logger
|
|
53
125
|
* Supports both legacy level-based and new mode-based configuration
|
|
@@ -60,6 +132,16 @@ export interface LoggerConfig {
|
|
|
60
132
|
level?: LogLevel;
|
|
61
133
|
/** Optional environment identifier for context (e.g., 'production', 'staging') */
|
|
62
134
|
environment?: string;
|
|
135
|
+
/** Custom output handler function to replace console output (backward compatibility) */
|
|
136
|
+
outputHandler?: LogOutputHandler;
|
|
137
|
+
/** Array of output targets for multiple simultaneous outputs */
|
|
138
|
+
outputs?: OutputTarget[];
|
|
139
|
+
/** Enhanced outputs with advanced configuration support */
|
|
140
|
+
enhancedOutputs?: EnhancedOutputTarget[];
|
|
141
|
+
/** Whether to suppress default console output (useful with custom outputHandler) */
|
|
142
|
+
suppressConsoleOutput?: boolean;
|
|
143
|
+
/** Advanced configuration for built-in handlers */
|
|
144
|
+
advancedOutputConfig?: AdvancedOutputConfig;
|
|
63
145
|
}
|
|
64
146
|
/**
|
|
65
147
|
* Configuration options for automatic data redaction
|
|
@@ -91,25 +173,25 @@ export interface ILogEngine {
|
|
|
91
173
|
/** Configure the logger with new settings */
|
|
92
174
|
configure(config: Partial<LoggerConfig>): void;
|
|
93
175
|
/** Log a debug message with automatic data redaction */
|
|
94
|
-
debug(message: string, data?:
|
|
176
|
+
debug(message: string, data?: LogData): void;
|
|
95
177
|
/** Log an info message with automatic data redaction */
|
|
96
|
-
info(message: string, data?:
|
|
178
|
+
info(message: string, data?: LogData): void;
|
|
97
179
|
/** Log a warn message with automatic data redaction */
|
|
98
|
-
warn(message: string, data?:
|
|
180
|
+
warn(message: string, data?: LogData): void;
|
|
99
181
|
/** Log an error message with automatic data redaction */
|
|
100
|
-
error(message: string, data?:
|
|
182
|
+
error(message: string, data?: LogData): void;
|
|
101
183
|
/** Log a message with automatic data redaction */
|
|
102
|
-
log(message: string, data?:
|
|
184
|
+
log(message: string, data?: LogData): void;
|
|
103
185
|
/** Log a debug message without redaction */
|
|
104
|
-
debugRaw(message: string, data?:
|
|
186
|
+
debugRaw(message: string, data?: LogData): void;
|
|
105
187
|
/** Log an info message without redaction */
|
|
106
|
-
infoRaw(message: string, data?:
|
|
188
|
+
infoRaw(message: string, data?: LogData): void;
|
|
107
189
|
/** Log a warn message without redaction */
|
|
108
|
-
warnRaw(message: string, data?:
|
|
190
|
+
warnRaw(message: string, data?: LogData): void;
|
|
109
191
|
/** Log an error message without redaction */
|
|
110
|
-
errorRaw(message: string, data?:
|
|
192
|
+
errorRaw(message: string, data?: LogData): void;
|
|
111
193
|
/** Log a message without redaction */
|
|
112
|
-
logRaw(message: string, data?:
|
|
194
|
+
logRaw(message: string, data?: LogData): void;
|
|
113
195
|
/** Configure redaction settings */
|
|
114
196
|
configureRedaction(config: Partial<RedactionConfig>): void;
|
|
115
197
|
/** Reset redaction configuration to defaults */
|
|
@@ -135,15 +217,15 @@ export interface ILogEngine {
|
|
|
135
217
|
*/
|
|
136
218
|
export interface ILogEngineWithoutRedaction {
|
|
137
219
|
/** Log a debug message without redaction */
|
|
138
|
-
debug(message: string, data?:
|
|
220
|
+
debug(message: string, data?: LogData): void;
|
|
139
221
|
/** Log an info message without redaction */
|
|
140
|
-
info(message: string, data?:
|
|
222
|
+
info(message: string, data?: LogData): void;
|
|
141
223
|
/** Log a warn message without redaction */
|
|
142
|
-
warn(message: string, data?:
|
|
224
|
+
warn(message: string, data?: LogData): void;
|
|
143
225
|
/** Log an error message without redaction */
|
|
144
|
-
error(message: string, data?:
|
|
226
|
+
error(message: string, data?: LogData): void;
|
|
145
227
|
/** Log a message without redaction */
|
|
146
|
-
log(message: string, data?:
|
|
228
|
+
log(message: string, data?: LogData): void;
|
|
147
229
|
}
|
|
148
230
|
/**
|
|
149
231
|
* Interface for the DataRedactor static class methods
|
|
@@ -165,7 +247,7 @@ export interface IDataRedactor {
|
|
|
165
247
|
/** Test if a field name would be redacted */
|
|
166
248
|
testFieldRedaction(fieldName: string): boolean;
|
|
167
249
|
/** Redact sensitive data from any value */
|
|
168
|
-
redactData(data:
|
|
250
|
+
redactData(data: LogData): LogData;
|
|
169
251
|
}
|
|
170
252
|
/**
|
|
171
253
|
* Interface for the RedactionController methods
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,oBAAY,QAAQ;IAChB,qFAAqF;IACrF,KAAK,IAAI;IACT,2DAA2D;IAC3D,IAAI,IAAI;IACR,kEAAkE;IAClE,IAAI,IAAI;IACR,sEAAsE;IACtE,KAAK,IAAI;IACT,kGAAkG;IAClG,GAAG,KAAK;CACX;AAED;;;GAGG;AACH,oBAAY,OAAO;IACf,kEAAkE;IAClE,KAAK,IAAI;IACT,uDAAuD;IACvD,IAAI,IAAI;IACR,gDAAgD;IAChD,IAAI,IAAI;IACR,0CAA0C;IAC1C,KAAK,IAAI;IACT,8CAA8C;IAC9C,MAAM,IAAI;IACV,kDAAkD;IAClD,GAAG,IAAI;CACV;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB,qCAAqC;IACrC,SAAS,EAAE,IAAI,CAAC;IAChB,2CAA2C;IAC3C,KAAK,EAAE,QAAQ,CAAC;IAChB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;0EACsE;IACtE,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B;;;GAGG;AACH,oBAAY,QAAQ;IAChB,qFAAqF;IACrF,KAAK,IAAI;IACT,2DAA2D;IAC3D,IAAI,IAAI;IACR,kEAAkE;IAClE,IAAI,IAAI;IACR,sEAAsE;IACtE,KAAK,IAAI;IACT,kGAAkG;IAClG,GAAG,KAAK;CACX;AAED;;;GAGG;AACH,oBAAY,OAAO;IACf,kEAAkE;IAClE,KAAK,IAAI;IACT,uDAAuD;IACvD,IAAI,IAAI;IACR,gDAAgD;IAChD,IAAI,IAAI;IACR,0CAA0C;IAC1C,KAAK,IAAI;IACT,8CAA8C;IAC9C,MAAM,IAAI;IACV,kDAAkD;IAClD,GAAG,IAAI;CACV;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB,qCAAqC;IACrC,SAAS,E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D;IACrD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6EAA6E;IAC7E,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,yEAAyE;IACzE,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,2EAA2E;IAC3E,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,iEAAiE;IACjE,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
|
package/package.json
CHANGED
|
@@ -1,68 +1,80 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wgtechlabs/log-engine",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A lightweight, security-first logging utility with automatic data redaction for Node.js applications - the first logging library with built-in PII protection.",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"test
|
|
43
|
-
"test:
|
|
44
|
-
"test:
|
|
45
|
-
"test:
|
|
46
|
-
"test:
|
|
47
|
-
"test:
|
|
48
|
-
"test:
|
|
49
|
-
"test:redaction
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@wgtechlabs/log-engine",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "A lightweight, security-first logging utility with automatic data redaction for Node.js applications - the first logging library with built-in PII protection.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"logging",
|
|
8
|
+
"security",
|
|
9
|
+
"redaction",
|
|
10
|
+
"pii-protection",
|
|
11
|
+
"data-redaction",
|
|
12
|
+
"typescript",
|
|
13
|
+
"nodejs",
|
|
14
|
+
"bot",
|
|
15
|
+
"discord",
|
|
16
|
+
"telegram",
|
|
17
|
+
"privacy",
|
|
18
|
+
"gdpr",
|
|
19
|
+
"compliance"
|
|
20
|
+
],
|
|
21
|
+
"packageManager": "yarn@4.9.2",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "WG Tech Labs <opensource@wgtechlabs.com> (https://wgtechlabs.com)",
|
|
24
|
+
"contributors": [
|
|
25
|
+
"Waren Gonzaga <opensource@warengonzaga.com> (https://warengonzaga.com)"
|
|
26
|
+
],
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/**/*",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/wgtechlabs/log-engine.git"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc",
|
|
40
|
+
"start": "node dist/index.js",
|
|
41
|
+
"prepublishOnly": "yarn build",
|
|
42
|
+
"test": "jest",
|
|
43
|
+
"test:watch": "jest --watch",
|
|
44
|
+
"test:coverage": "jest --coverage",
|
|
45
|
+
"test:coverage:watch": "jest --coverage --watch",
|
|
46
|
+
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
47
|
+
"test:unit": "jest --testNamePattern=\"^((?!integration).)*$\"",
|
|
48
|
+
"test:integration": "jest integration.test.ts",
|
|
49
|
+
"test:redaction": "jest --testPathPattern=\"redaction/\"",
|
|
50
|
+
"lint": "eslint src/**/*.ts",
|
|
51
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
52
|
+
"lint:security": "eslint src/**/*.ts --config eslint.security.config.js",
|
|
53
|
+
"secure:scan": "snyk code test",
|
|
54
|
+
"secure:test": "snyk test --org=wgtechlabs",
|
|
55
|
+
"secure:code": "snyk code test --org=wgtechlabs",
|
|
56
|
+
"secure": "run-s lint:security secure:test secure:code",
|
|
57
|
+
"validate": "run-s lint test build",
|
|
58
|
+
"clean": "rm -rf dist coverage",
|
|
59
|
+
"coverage:open": "open coverage/lcov-report/index.html",
|
|
60
|
+
"coverage:upload": "curl -Os https://uploader.codecov.io/latest/windows/codecov.exe && codecov.exe"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/eslint-plugin-security": "^3",
|
|
64
|
+
"@types/jest": "^29.0.0",
|
|
65
|
+
"@types/node": "^18.0.0",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
67
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
68
|
+
"eslint": "^8.45.0",
|
|
69
|
+
"eslint-plugin-security": "^2.0.0",
|
|
70
|
+
"jest": "^29.0.0",
|
|
71
|
+
"npm-run-all": "^4.1.5",
|
|
72
|
+
"snyk": "^1.1000.0",
|
|
73
|
+
"ts-jest": "^29.0.0",
|
|
74
|
+
"ts-node": "^10.0.0",
|
|
75
|
+
"typescript": "^5.8.3"
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=16.0.0"
|
|
79
|
+
}
|
|
80
|
+
}
|