@onlineapps/infrastructure-tools 1.0.30 → 1.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/infrastructure-tools",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Infrastructure orchestration utilities for OA Drive infrastructure services (health tracking, queue initialization, service discovery)",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -22,7 +22,8 @@
22
22
  "dependencies": {
23
23
  "@onlineapps/mq-client-core": "^1.0.47",
24
24
  "@onlineapps/service-common": "^1.0.5",
25
- "uuid": "^9.0.1"
25
+ "uuid": "^9.0.1",
26
+ "@onlineapps/infra-logger": "^1.0.0"
26
27
  },
27
28
  "devDependencies": {
28
29
  "jest": "^29.7.0"
package/src/index.js CHANGED
@@ -38,6 +38,9 @@ const {
38
38
  const BaseClient = require('@onlineapps/mq-client-core');
39
39
  const queueConfig = require('@onlineapps/mq-client-core/src/config/queueConfig');
40
40
 
41
+ // Re-export infra-logger (infrastructure services should use infrastructure-tools, not infra-logger directly)
42
+ const { createLogger: createInfraLogger } = require('@onlineapps/infra-logger');
43
+
41
44
  const { initInfrastructureQueues } = require('./orchestration/initInfrastructureQueues');
42
45
  const {
43
46
  createHealthPublisher,
@@ -83,9 +86,12 @@ module.exports = {
83
86
  createBaseClientAdapter,
84
87
  createAmqplibAdapter,
85
88
 
86
- // Logger utility (consistent with conn-infra-mq pattern)
89
+ // Logger utilities
90
+ // createLogger - legacy logger wrapper (for backward compatibility)
87
91
  createLogger,
88
-
92
+ // createInfraLogger - structured logging from @onlineapps/infra-logger (preferred)
93
+ createInfraLogger,
94
+
89
95
  // Monitoring utilities
90
96
  sendQueueMismatchAlert
91
97
  };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const { sendQueueMismatchAlert } = require('../monitoring/queueMismatchReporter');
4
+ const { createLogger: createInfraLogger } = require('@onlineapps/infra-logger');
4
5
 
5
6
  /**
6
7
  * initInfrastructureQueues.js
@@ -79,6 +80,17 @@ async function initInfrastructureQueues(channel, options = {}) {
79
80
  return workingChannel;
80
81
  };
81
82
 
83
+ // Structured log: queue initialization start
84
+ const log = createInfraLogger('infrastructure-tools', 'queue-init');
85
+ log.lifecycle(serviceName, 'INIT_START', {
86
+ handler: 'initInfrastructureQueues',
87
+ function: 'initInfrastructureQueues',
88
+ input: {
89
+ queues_count: queuesToCreate.length,
90
+ queues: queuesToCreate
91
+ }
92
+ });
93
+
82
94
  logger.log(`[QueueInit] Initializing ${queuesToCreate.length} infrastructure queues...`);
83
95
 
84
96
  for (const queueName of queuesToCreate) {
@@ -204,6 +216,14 @@ async function initInfrastructureQueues(channel, options = {}) {
204
216
  }
205
217
  }
206
218
 
219
+ // Structured log: queue initialization complete
220
+ log.lifecycle(serviceName, 'INIT_COMPLETE', {
221
+ handler: 'initInfrastructureQueues',
222
+ function: 'initInfrastructureQueues',
223
+ input: { queues_count: queuesToCreate.length },
224
+ output: { status: 'completed', queues_initialized: queuesToCreate.length }
225
+ });
226
+
207
227
  logger.log(`[QueueInit] Infrastructure queues initialization complete`);
208
228
  }
209
229