logs-gateway 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 nx-morpheus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,299 @@
1
+ # logs-gateway
2
+
3
+ A standardized logging gateway for Node.js applications. Provides flexible logging with console output, file output, environment variable configuration, and custom logger injection.
4
+
5
+ ## Features
6
+
7
+ - ✅ **Console output** (default)
8
+ - ✅ **File output** (optional)
9
+ - ✅ **Dual output** (console + file)
10
+ - ✅ **Environment variable configuration**
11
+ - ✅ **Custom logger injection** (Winston, Pino, etc.)
12
+ - ✅ **Package-specific prefixes**
13
+ - ✅ **Multiple log levels** (debug, info, warn, error)
14
+ - ✅ **Multiple formats** (text, json)
15
+ - ✅ **TypeScript support**
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install logs-gateway
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ```typescript
26
+ import { createLogger } from 'logs-gateway';
27
+
28
+ // Create a package-specific logger
29
+ const logger = createLogger(
30
+ { packageName: 'MY_APP', envPrefix: 'MY_APP' },
31
+ { logToFile: true, logFilePath: '/var/log/myapp.log' }
32
+ );
33
+
34
+ // Use it
35
+ logger.info('Application initialized');
36
+ logger.debug('Debug info', { data: 'some data' });
37
+ logger.error('Error occurred', { error: new Error('Something went wrong') });
38
+ ```
39
+
40
+ ## Configuration
41
+
42
+ ### Via Constructor
43
+
44
+ ```typescript
45
+ const logger = createLogger(
46
+ { packageName: 'MY_PACKAGE', envPrefix: 'MY_PACKAGE' },
47
+ {
48
+ logToConsole: true, // default: true
49
+ logToFile: true, // default: false
50
+ logFilePath: '/var/log/app.log', // required if logToFile
51
+ logLevel: 'debug', // debug|info|warn|error
52
+ logFormat: 'json' // text|json
53
+ }
54
+ );
55
+ ```
56
+
57
+ ### Via Environment Variables
58
+
59
+ ```bash
60
+ # Console logging
61
+ MY_APP_LOG_TO_CONSOLE=true|false
62
+
63
+ # File logging
64
+ MY_APP_LOG_TO_FILE=true|false
65
+ MY_APP_LOG_FILE=/path/to/log
66
+
67
+ # Log level
68
+ MY_APP_LOG_LEVEL=debug|info|warn|error
69
+
70
+ # Log format
71
+ MY_APP_LOG_FORMAT=text|json
72
+
73
+ # Debug mode (enables debug level)
74
+ DEBUG=my-app-namespace
75
+ ```
76
+
77
+ ## Usage Examples
78
+
79
+ ### Example 1: Web Application
80
+
81
+ ```typescript
82
+ // src/logger.ts
83
+ import { createLogger, LoggingConfig, LogsGateway } from 'logs-gateway';
84
+
85
+ export function createAppLogger(config?: LoggingConfig): LogsGateway {
86
+ return createLogger(
87
+ {
88
+ packageName: 'WEB_APP',
89
+ envPrefix: 'WEB_APP',
90
+ debugNamespace: 'web-app'
91
+ },
92
+ config
93
+ );
94
+ }
95
+
96
+ // src/index.ts
97
+ import { createAppLogger } from './logger';
98
+
99
+ export class WebApp {
100
+ private logger: LogsGateway;
101
+
102
+ constructor(config: AppConfig & { logging?: LoggingConfig }) {
103
+ this.logger = createAppLogger(config.logging);
104
+ this.logger.info('Web application initialized', { version: '1.0.0' });
105
+ }
106
+
107
+ async handleRequest(request: Request): Promise<Response> {
108
+ this.logger.debug('Handling request', { requestId: request.id });
109
+ // ... processing
110
+ this.logger.info('Request processed', { responseTime: Date.now() - request.startTime });
111
+ return response;
112
+ }
113
+ }
114
+ ```
115
+
116
+ ### Example 2: Database Service
117
+
118
+ ```typescript
119
+ // src/logger.ts
120
+ import { createLogger, LoggingConfig, LogsGateway } from 'logs-gateway';
121
+
122
+ export function createDbLogger(config?: LoggingConfig): LogsGateway {
123
+ return createLogger(
124
+ {
125
+ packageName: 'DATABASE_SERVICE',
126
+ envPrefix: 'DB_SERVICE',
127
+ debugNamespace: 'db-service'
128
+ },
129
+ config
130
+ );
131
+ }
132
+
133
+ // src/index.ts
134
+ import { createDbLogger } from './logger';
135
+
136
+ export class DatabaseService {
137
+ private logger: LogsGateway;
138
+
139
+ constructor(config: DbConfig & { logging?: LoggingConfig }) {
140
+ this.logger = createDbLogger(config.logging);
141
+ this.logger.info('Database service initialized');
142
+ }
143
+
144
+ async query(sql: string): Promise<any> {
145
+ this.logger.debug('Executing query', { sql });
146
+ // ... execute query
147
+ }
148
+ }
149
+ ```
150
+
151
+ ### Example 3: Custom Logger Integration (Winston)
152
+
153
+ ```typescript
154
+ import winston from 'winston';
155
+ import { createLogger, LoggingConfig } from '@nx-morpheus/logs-gateway';
156
+
157
+ const winstonLogger = winston.createLogger({
158
+ level: 'info',
159
+ format: winston.format.json(),
160
+ transports: [
161
+ new winston.transports.File({ filename: 'error.log', level: 'error' }),
162
+ new winston.transports.File({ filename: 'combined.log' })
163
+ ]
164
+ });
165
+
166
+ const customLogger = {
167
+ debug: (msg: string, data?: any) => winstonLogger.debug(msg, data),
168
+ info: (msg: string, data?: any) => winstonLogger.info(msg, data),
169
+ warn: (msg: string, data?: any) => winstonLogger.warn(msg, data),
170
+ error: (msg: string, data?: any) => winstonLogger.error(msg, data)
171
+ };
172
+
173
+ const logger = createLogger(
174
+ { packageName: 'MY_APP', envPrefix: 'MY_APP' },
175
+ { customLogger } // Use Winston instead of built-in logger
176
+ );
177
+ ```
178
+
179
+ ### Example 4: Multiple Services Using the Same Gateway
180
+
181
+ Each service just needs:
182
+
183
+ 1. **Add dependency**: `"logs-gateway": "^1.0.0"`
184
+ 2. **Create factory**:
185
+
186
+ ```typescript
187
+ // Service 1: Web API
188
+ export const logger = createLogger({ packageName: 'WEB_API', envPrefix: 'WEB_API' });
189
+
190
+ // Service 2: Database
191
+ export const logger = createLogger({ packageName: 'DATABASE', envPrefix: 'DATABASE' });
192
+
193
+ // Service 3: Cache
194
+ export const logger = createLogger({ packageName: 'CACHE_SERVICE', envPrefix: 'CACHE' });
195
+
196
+ // Service 4: Queue
197
+ export const logger = createLogger({ packageName: 'QUEUE_SERVICE', envPrefix: 'QUEUE' });
198
+
199
+ // Service 5: Auth
200
+ export const logger = createLogger({ packageName: 'AUTH_SERVICE', envPrefix: 'AUTH' });
201
+
202
+ // Service 6: Monitoring
203
+ export const logger = createLogger({ packageName: 'MONITORING', envPrefix: 'MONITOR' });
204
+
205
+ // Service 7: File Storage
206
+ export const logger = createLogger({ packageName: 'FILE_STORAGE', envPrefix: 'STORAGE' });
207
+
208
+ // Service 8: Email Service
209
+ export const logger = createLogger({ packageName: 'EMAIL_SERVICE', envPrefix: 'EMAIL' });
210
+
211
+ // Service 9: Analytics
212
+ export const logger = createLogger({ packageName: 'ANALYTICS', envPrefix: 'ANALYTICS' });
213
+
214
+ // Service 10: Notifications
215
+ export const logger = createLogger({ packageName: 'NOTIFICATIONS', envPrefix: 'NOTIFY' });
216
+ ```
217
+
218
+ **Update logs-gateway once, all services benefit!**
219
+
220
+ ## API Reference
221
+
222
+ ### `createLogger(packageConfig, userConfig?)`
223
+
224
+ Creates a new logger instance.
225
+
226
+ **Parameters:**
227
+ - `packageConfig: LoggerPackageConfig` - Package identification
228
+ - `userConfig?: LoggingConfig` - Optional logging configuration
229
+
230
+ **Returns:** `LogsGateway` instance
231
+
232
+ ### `LogsGateway` Class
233
+
234
+ #### Methods
235
+
236
+ - `debug(message: string, data?: any): void` - Log debug message
237
+ - `info(message: string, data?: any): void` - Log info message
238
+ - `warn(message: string, data?: any): void` - Log warning message
239
+ - `error(message: string, data?: any): void` - Log error message
240
+ - `getConfig(): Readonly<InternalLoggingConfig>` - Get current configuration
241
+ - `isLevelEnabled(level: LogLevel): boolean` - Check if level is enabled
242
+
243
+ #### Log Levels
244
+
245
+ - `debug` - Detailed information (lowest priority)
246
+ - `info` - General information
247
+ - `warn` - Warning messages
248
+ - `error` - Error messages (highest priority)
249
+
250
+ #### Log Formats
251
+
252
+ **Text Format:**
253
+ ```
254
+ [2024-01-15T10:30:45.123Z] [MY_APP] [INFO] Application initialized {"version":"1.0.0"}
255
+ ```
256
+
257
+ **JSON Format:**
258
+ ```json
259
+ {
260
+ "timestamp": "2024-01-15T10:30:45.123Z",
261
+ "package": "MY_APP",
262
+ "level": "INFO",
263
+ "message": "Application initialized",
264
+ "data": {"version": "1.0.0"}
265
+ }
266
+ ```
267
+
268
+ ## Environment Variables
269
+
270
+ All environment variables follow the pattern: `{ENV_PREFIX}_{SETTING}`
271
+
272
+ | Variable | Description | Default |
273
+ |----------|-------------|---------|
274
+ | `{PREFIX}_LOG_TO_CONSOLE` | Enable console output | `true` |
275
+ | `{PREFIX}_LOG_TO_FILE` | Enable file output | `false` |
276
+ | `{PREFIX}_LOG_FILE` | Log file path | Required if file logging |
277
+ | `{PREFIX}_LOG_LEVEL` | Minimum log level | `info` |
278
+ | `{PREFIX}_LOG_FORMAT` | Output format | `text` |
279
+ | `DEBUG` | Debug namespace | Enables debug level |
280
+
281
+ ## Development
282
+
283
+ ```bash
284
+ # Install dependencies
285
+ npm install
286
+
287
+ # Build the project
288
+ npm run build
289
+
290
+ # Watch mode
291
+ npm run dev
292
+
293
+ # Clean build artifacts
294
+ npm run clean
295
+ ```
296
+
297
+ ## License
298
+
299
+ MIT
@@ -0,0 +1,35 @@
1
+ /**
2
+ * logs-gateway - Main Entry Point
3
+ *
4
+ * This file exports all public APIs and provides the main factory function.
5
+ */
6
+ export type { LogLevel, LogFormat, LoggingConfig, CustomLogger, LoggerPackageConfig, LogEntry, InternalLoggingConfig } from './types';
7
+ export { LogsGateway } from './logger';
8
+ import { LogsGateway } from './logger';
9
+ import type { LoggerPackageConfig, LoggingConfig } from './types';
10
+ /**
11
+ * Create a package-specific logger instance
12
+ *
13
+ * @param packageConfig - Package identification (name, env prefix, debug namespace)
14
+ * @param userConfig - Optional logging configuration
15
+ * @returns LogsGateway instance configured for the package
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * import { createLogger } from 'logs-gateway';
20
+ *
21
+ * const logger = createLogger(
22
+ * { packageName: 'MY_APP', envPrefix: 'MY_APP', debugNamespace: 'my-app' },
23
+ * { logToFile: true, logFilePath: '/var/log/myapp.log' }
24
+ * );
25
+ *
26
+ * logger.info('Application initialized');
27
+ * ```
28
+ */
29
+ export declare function createLogger(packageConfig: LoggerPackageConfig, userConfig?: LoggingConfig): LogsGateway;
30
+ declare const _default: {
31
+ createLogger: typeof createLogger;
32
+ LogsGateway: typeof LogsGateway;
33
+ };
34
+ export default _default;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,QAAQ,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,mBAAmB,EAClC,UAAU,CAAC,EAAE,aAAa,GACzB,WAAW,CAEb;;;;;AAGD,wBAGE"}
package/dist/index.js ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /**
3
+ * logs-gateway - Main Entry Point
4
+ *
5
+ * This file exports all public APIs and provides the main factory function.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LogsGateway = void 0;
9
+ exports.createLogger = createLogger;
10
+ // Re-export the LogsGateway class
11
+ var logger_1 = require("./logger");
12
+ Object.defineProperty(exports, "LogsGateway", { enumerable: true, get: function () { return logger_1.LogsGateway; } });
13
+ // Import LogsGateway for the factory function
14
+ const logger_2 = require("./logger");
15
+ /**
16
+ * Create a package-specific logger instance
17
+ *
18
+ * @param packageConfig - Package identification (name, env prefix, debug namespace)
19
+ * @param userConfig - Optional logging configuration
20
+ * @returns LogsGateway instance configured for the package
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { createLogger } from 'logs-gateway';
25
+ *
26
+ * const logger = createLogger(
27
+ * { packageName: 'MY_APP', envPrefix: 'MY_APP', debugNamespace: 'my-app' },
28
+ * { logToFile: true, logFilePath: '/var/log/myapp.log' }
29
+ * );
30
+ *
31
+ * logger.info('Application initialized');
32
+ * ```
33
+ */
34
+ function createLogger(packageConfig, userConfig) {
35
+ return new logger_2.LogsGateway(packageConfig, userConfig);
36
+ }
37
+ // Default export for convenience
38
+ exports.default = {
39
+ createLogger,
40
+ LogsGateway: logger_2.LogsGateway
41
+ };
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAuCH,oCAKC;AA/BD,kCAAkC;AAClC,mCAAuC;AAA9B,qGAAA,WAAW,OAAA;AAEpB,8CAA8C;AAC9C,qCAAuC;AAGvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,YAAY,CAC1B,aAAkC,EAClC,UAA0B;IAE1B,OAAO,IAAI,oBAAW,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AACpD,CAAC;AAED,iCAAiC;AACjC,kBAAe;IACb,YAAY;IACZ,WAAW,EAAX,oBAAW;CACZ,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * logs-gateway - Core LogsGateway Implementation
3
+ *
4
+ * This file contains the main Logger class that handles all logging functionality.
5
+ */
6
+ import { LogLevel, LoggingConfig, LoggerPackageConfig, InternalLoggingConfig } from './types';
7
+ /**
8
+ * Main LogsGateway class for handling all logging operations
9
+ */
10
+ export declare class LogsGateway {
11
+ private config;
12
+ private packageConfig;
13
+ private levelPriority;
14
+ constructor(packageConfig: LoggerPackageConfig, userConfig?: LoggingConfig);
15
+ /**
16
+ * Ensure the log directory exists, creating it if necessary
17
+ */
18
+ private ensureLogDirectory;
19
+ /**
20
+ * Check if a log level should be output based on current configuration
21
+ */
22
+ private shouldLog;
23
+ /**
24
+ * Format a log entry according to the configured format
25
+ */
26
+ private formatLogEntry;
27
+ /**
28
+ * Write formatted message to console
29
+ */
30
+ private writeToConsole;
31
+ /**
32
+ * Write formatted message to log file
33
+ */
34
+ private writeToFile;
35
+ /**
36
+ * Core logging method that handles all log output
37
+ */
38
+ private log;
39
+ /**
40
+ * Log debug message (only shown when logLevel is 'debug')
41
+ */
42
+ debug(message: string, data?: any): void;
43
+ /**
44
+ * Log informational message
45
+ */
46
+ info(message: string, data?: any): void;
47
+ /**
48
+ * Log warning message
49
+ */
50
+ warn(message: string, data?: any): void;
51
+ /**
52
+ * Log error message
53
+ */
54
+ error(message: string, data?: any): void;
55
+ /**
56
+ * Get current logger configuration (for debugging/testing)
57
+ */
58
+ getConfig(): Readonly<InternalLoggingConfig>;
59
+ /**
60
+ * Check if a specific log level is enabled
61
+ */
62
+ isLevelEnabled(level: LogLevel): boolean;
63
+ }
64
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,QAAQ,EAER,aAAa,EACb,mBAAmB,EAEnB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,aAAa,CAKnB;gBAEU,aAAa,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,aAAa;IAmD1E;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;OAEG;IACH,OAAO,CAAC,SAAS;IAMjB;;OAEG;IACH,OAAO,CAAC,cAAc;IAsBtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,CAAC,WAAW;IAcnB;;OAEG;IACH,OAAO,CAAC,GAAG;IAwBX;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAIxC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAIvC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAIvC;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAIxC;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,qBAAqB,CAAC;IAI5C;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;CAGzC"}
package/dist/logger.js ADDED
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ /**
3
+ * logs-gateway - Core LogsGateway Implementation
4
+ *
5
+ * This file contains the main Logger class that handles all logging functionality.
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || (function () {
24
+ var ownKeys = function(o) {
25
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26
+ var ar = [];
27
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
+ return ar;
29
+ };
30
+ return ownKeys(o);
31
+ };
32
+ return function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ })();
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.LogsGateway = void 0;
42
+ const fs = __importStar(require("fs"));
43
+ const path = __importStar(require("path"));
44
+ /**
45
+ * Main LogsGateway class for handling all logging operations
46
+ */
47
+ class LogsGateway {
48
+ constructor(packageConfig, userConfig) {
49
+ this.levelPriority = {
50
+ debug: 0,
51
+ info: 1,
52
+ warn: 2,
53
+ error: 3
54
+ };
55
+ this.packageConfig = packageConfig;
56
+ // Check DEBUG environment variable
57
+ const envPrefix = packageConfig.envPrefix;
58
+ const debugEnabled = process.env.DEBUG?.includes(packageConfig.debugNamespace || packageConfig.packageName.toLowerCase());
59
+ // Build configuration with precedence: user config > env vars > defaults
60
+ this.config = {
61
+ logToConsole: userConfig?.logToConsole ??
62
+ (process.env[`${envPrefix}_LOG_TO_CONSOLE`] !== 'false'),
63
+ logToFile: userConfig?.logToFile ??
64
+ (process.env[`${envPrefix}_LOG_TO_FILE`] === 'true'),
65
+ logFilePath: userConfig?.logFilePath ??
66
+ process.env[`${envPrefix}_LOG_FILE`] ??
67
+ '',
68
+ logLevel: userConfig?.logLevel ??
69
+ process.env[`${envPrefix}_LOG_LEVEL`] ??
70
+ (debugEnabled ? 'debug' : 'info'),
71
+ logFormat: userConfig?.logFormat ??
72
+ process.env[`${envPrefix}_LOG_FORMAT`] ??
73
+ 'text',
74
+ packageName: packageConfig.packageName,
75
+ ...(userConfig?.customLogger && { customLogger: userConfig.customLogger })
76
+ };
77
+ // Validate configuration
78
+ if (this.config.logToFile && !this.config.logFilePath) {
79
+ throw new Error(`[logs-gateway] ${packageConfig.packageName}: logFilePath is required when logToFile is true. ` +
80
+ `Set it via config or ${envPrefix}_LOG_FILE environment variable.`);
81
+ }
82
+ // Ensure log directory exists if file logging is enabled
83
+ if (this.config.logToFile && this.config.logFilePath) {
84
+ this.ensureLogDirectory(this.config.logFilePath);
85
+ }
86
+ }
87
+ // --------------------------------------------------------------------------
88
+ // PRIVATE METHODS
89
+ // --------------------------------------------------------------------------
90
+ /**
91
+ * Ensure the log directory exists, creating it if necessary
92
+ */
93
+ ensureLogDirectory(filePath) {
94
+ try {
95
+ const dir = path.dirname(filePath);
96
+ if (!fs.existsSync(dir)) {
97
+ fs.mkdirSync(dir, { recursive: true });
98
+ }
99
+ }
100
+ catch (err) {
101
+ console.error(`[logs-gateway] ${this.packageConfig.packageName}: Failed to create log directory:`, err);
102
+ }
103
+ }
104
+ /**
105
+ * Check if a log level should be output based on current configuration
106
+ */
107
+ shouldLog(level) {
108
+ const currentLevelPriority = this.levelPriority[this.config.logLevel];
109
+ const messageLevelPriority = this.levelPriority[level];
110
+ return messageLevelPriority >= currentLevelPriority;
111
+ }
112
+ /**
113
+ * Format a log entry according to the configured format
114
+ */
115
+ formatLogEntry(level, message, data) {
116
+ const timestamp = new Date().toISOString();
117
+ const logEntry = {
118
+ timestamp,
119
+ package: this.packageConfig.packageName,
120
+ level: level.toUpperCase(),
121
+ message,
122
+ ...(data !== undefined && { data })
123
+ };
124
+ if (this.config.logFormat === 'json') {
125
+ return JSON.stringify(logEntry);
126
+ }
127
+ else {
128
+ // Text format: [timestamp] [PACKAGE] [LEVEL] message
129
+ let formatted = `[${timestamp}] [${this.packageConfig.packageName}] [${level.toUpperCase()}] ${message}`;
130
+ if (data !== undefined) {
131
+ formatted += ` ${typeof data === 'object' ? JSON.stringify(data) : data}`;
132
+ }
133
+ return formatted;
134
+ }
135
+ }
136
+ /**
137
+ * Write formatted message to console
138
+ */
139
+ writeToConsole(level, formattedMessage) {
140
+ if (!this.config.logToConsole)
141
+ return;
142
+ if (level === 'error') {
143
+ console.error(formattedMessage);
144
+ }
145
+ else {
146
+ console.log(formattedMessage);
147
+ }
148
+ }
149
+ /**
150
+ * Write formatted message to log file
151
+ */
152
+ writeToFile(formattedMessage) {
153
+ if (!this.config.logToFile || !this.config.logFilePath)
154
+ return;
155
+ try {
156
+ fs.appendFileSync(this.config.logFilePath, formattedMessage + '\n', 'utf8');
157
+ }
158
+ catch (err) {
159
+ // Fallback to console if file write fails
160
+ console.error(`[logs-gateway] ${this.packageConfig.packageName}: Failed to write to log file (${this.config.logFilePath}):`, err);
161
+ }
162
+ }
163
+ /**
164
+ * Core logging method that handles all log output
165
+ */
166
+ log(level, message, data) {
167
+ // Check if we should log this level
168
+ if (!this.shouldLog(level))
169
+ return;
170
+ // Use custom logger if provided
171
+ if (this.config.customLogger) {
172
+ this.config.customLogger[level](message, data);
173
+ return;
174
+ }
175
+ // Format the log entry
176
+ const formattedMessage = this.formatLogEntry(level, message, data);
177
+ // Write to console
178
+ this.writeToConsole(level, formattedMessage);
179
+ // Write to file
180
+ this.writeToFile(formattedMessage);
181
+ }
182
+ // --------------------------------------------------------------------------
183
+ // PUBLIC API
184
+ // --------------------------------------------------------------------------
185
+ /**
186
+ * Log debug message (only shown when logLevel is 'debug')
187
+ */
188
+ debug(message, data) {
189
+ this.log('debug', message, data);
190
+ }
191
+ /**
192
+ * Log informational message
193
+ */
194
+ info(message, data) {
195
+ this.log('info', message, data);
196
+ }
197
+ /**
198
+ * Log warning message
199
+ */
200
+ warn(message, data) {
201
+ this.log('warn', message, data);
202
+ }
203
+ /**
204
+ * Log error message
205
+ */
206
+ error(message, data) {
207
+ this.log('error', message, data);
208
+ }
209
+ /**
210
+ * Get current logger configuration (for debugging/testing)
211
+ */
212
+ getConfig() {
213
+ return { ...this.config };
214
+ }
215
+ /**
216
+ * Check if a specific log level is enabled
217
+ */
218
+ isLevelEnabled(level) {
219
+ return this.shouldLog(level);
220
+ }
221
+ }
222
+ exports.LogsGateway = LogsGateway;
223
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAU7B;;GAEG;AACH,MAAa,WAAW;IAUtB,YAAY,aAAkC,EAAE,UAA0B;QAPlE,kBAAa,GAA6B;YAChD,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;SACT,CAAC;QAGA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,mCAAmC;QACnC,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;QAC1C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAC9C,aAAa,CAAC,cAAc,IAAI,aA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AED;;OAEG;IACH,cAAc,CAAC,KAAe;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF;AAlND,kCAkNC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * logs-gateway - TypeScript Type Definitions
3
+ *
4
+ * This file contains all TypeScript interfaces and types for the logs gateway package.
5
+ */
6
+ /**
7
+ * Supported log levels in order of priority
8
+ */
9
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
10
+ /**
11
+ * Output format options for log entries
12
+ */
13
+ export type LogFormat = 'text' | 'json';
14
+ /**
15
+ * Configuration for logging behavior
16
+ */
17
+ export interface LoggingConfig {
18
+ /** Enable console output (default: true) */
19
+ logToConsole?: boolean;
20
+ /** Enable file output (default: false) */
21
+ logToFile?: boolean;
22
+ /** File path for logs (required if logToFile is true) */
23
+ logFilePath?: string;
24
+ /** Minimum log level to output (default: 'info') */
25
+ logLevel?: LogLevel;
26
+ /** Output format: 'text' or 'json' (default: 'text') */
27
+ logFormat?: LogFormat;
28
+ /** Custom logger implementation (advanced use) */
29
+ customLogger?: CustomLogger;
30
+ }
31
+ /**
32
+ * Custom logger interface for injecting external loggers (Winston, Pino, etc.)
33
+ */
34
+ export interface CustomLogger {
35
+ debug: (message: string, data?: any) => void;
36
+ info: (message: string, data?: any) => void;
37
+ warn: (message: string, data?: any) => void;
38
+ error: (message: string, data?: any) => void;
39
+ }
40
+ /**
41
+ * Package identification configuration
42
+ */
43
+ export interface LoggerPackageConfig {
44
+ /** Display name in logs (e.g., 'MY_APP', 'DATABASE_SERVICE') */
45
+ packageName: string;
46
+ /** Environment variable prefix (e.g., 'MY_APP', 'DB_SERVICE') */
47
+ envPrefix: string;
48
+ /** Debug namespace for DEBUG env var (e.g., 'my-app', 'db-service') */
49
+ debugNamespace?: string;
50
+ }
51
+ /**
52
+ * Structured log entry (used for JSON format)
53
+ */
54
+ export interface LogEntry {
55
+ timestamp: string;
56
+ package: string;
57
+ level: string;
58
+ message: string;
59
+ data?: any;
60
+ }
61
+ /**
62
+ * Internal configuration type with all required fields
63
+ */
64
+ export type InternalLoggingConfig = Required<Omit<LoggingConfig, 'customLogger'>> & {
65
+ customLogger?: CustomLogger;
66
+ packageName: string;
67
+ };
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,kDAAkD;IAClD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5C,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5C,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IAEpB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAElB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,GAAG;IAClF,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * logs-gateway - TypeScript Type Definitions
4
+ *
5
+ * This file contains all TypeScript interfaces and types for the logs gateway package.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "logs-gateway",
3
+ "version": "1.0.0",
4
+ "description": "Standardized logging gateway for Node.js applications",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "dev": "tsc --watch",
10
+ "clean": "rm -rf dist",
11
+ "prepublishOnly": "npm run clean && npm run build"
12
+ },
13
+ "keywords": [
14
+ "logging",
15
+ "logger",
16
+ "typescript",
17
+ "node",
18
+ "console",
19
+ "file",
20
+ "json"
21
+ ],
22
+ "author": "nx-morpheus",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/nx-intelligence/logs-gateway.git"
27
+ },
28
+ "homepage": "https://github.com/nx-intelligence/logs-gateway#readme",
29
+ "bugs": {
30
+ "url": "https://github.com/nx-intelligence/logs-gateway/issues"
31
+ },
32
+ "files": [
33
+ "dist/**/*",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "devDependencies": {
38
+ "@types/node": "^20.0.0",
39
+ "typescript": "^5.0.0"
40
+ },
41
+ "peerDependencies": {
42
+ "typescript": ">=4.0.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=16.0.0"
46
+ },
47
+ "type": "commonjs"
48
+ }