@log-ingestor/mssql 0.3.0 → 0.3.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.
- package/README.md +8 -1
- package/package.json +1 -1
- package/src/config.js +7 -1
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Disk-first Node.js logger with automatic ingestion into Microsoft SQL Server — no ELK, no log management headaches.
|
|
4
4
|
|
|
5
|
+
⚠️ **MSSQL database name is mandatory in the connection string.**
|
|
5
6
|
This package is the **MSSQL adapter** for the `log-ingestor` ecosystem.
|
|
6
7
|
It writes structured logs to disk and reliably ingests them into **Microsoft SQL Server** using a high‑performance background ingestor.
|
|
7
8
|
|
|
@@ -58,7 +59,13 @@ const logger = createLogger({
|
|
|
58
59
|
},
|
|
59
60
|
db: {
|
|
60
61
|
type: "mssql",
|
|
61
|
-
connection:
|
|
62
|
+
connection:
|
|
63
|
+
"Server=localhost,1433;" +
|
|
64
|
+
"Database=logsdb;" +
|
|
65
|
+
"User Id=sa;" +
|
|
66
|
+
"Password=***;" +
|
|
67
|
+
"Encrypt=true;" +
|
|
68
|
+
"TrustServerCertificate=true;"
|
|
62
69
|
},
|
|
63
70
|
batch: {
|
|
64
71
|
size: 200
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -7,10 +7,16 @@ function buildIngestorConfig({ logDir, db, batch }) {
|
|
|
7
7
|
throw new Error("db.type and db.connection are required");
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
if (!/Database=/i.test(db.connection)) {
|
|
11
|
+
throw new Error(
|
|
12
|
+
"MSSQL connection string must include Database=<db_name>"
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
return {
|
|
11
17
|
logDir,
|
|
12
18
|
db: {
|
|
13
|
-
type: db.type,
|
|
19
|
+
type: db.type,
|
|
14
20
|
connection: db.connection,
|
|
15
21
|
table: db.table || "unified_logs"
|
|
16
22
|
},
|