From dcf1c47328cc5008840d4751103ad41c8abebd20 Mon Sep 17 00:00:00 2001 From: Giuseppe Raffa <77052701+sesee3@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:25:31 +0200 Subject: [PATCH] feat: add logging for InfluxDB client initialization and PostgreSQL client acquisition --- api/src/storage/influx.js | 1 + api/src/storage/postgres.js | 1 + 2 files changed, 2 insertions(+) diff --git a/api/src/storage/influx.js b/api/src/storage/influx.js index 1101ecf..d6292c1 100644 --- a/api/src/storage/influx.js +++ b/api/src/storage/influx.js @@ -10,6 +10,7 @@ const client = new InfluxDB({ url, token }) const write = client.getWriteApi(org, boatTelemetry); const querying = client.getQueryApi(org); +console.log("InfluxDB client initialized with config:", { url, org, token: token ? '***' : null }); async function append(measurement, sensor, data) { const point = new Point(measurement) diff --git a/api/src/storage/postgres.js b/api/src/storage/postgres.js index c4c1f10..02e16de 100644 --- a/api/src/storage/postgres.js +++ b/api/src/storage/postgres.js @@ -30,6 +30,7 @@ Object.entries(pools).forEach(([name, pool]) => { async function getClient(db) { const pool = pools[db]; if (!pool) throw new Error(`Database pool type ${db} does not exist`); + console.log(`Acquiring client for ${db} database... with config:`, config); return await pool.connect(); }