@twin.org/logging-service 0.0.3-next.2 → 0.0.3-next.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # TWIN Logging Service
2
2
 
3
- Logging contract implementation and REST endpoint definitions.
3
+ Exposes logging operations through service routes and API contracts for server-side integration.
4
4
 
5
5
  ## Installation
6
6
 
package/docs/changelog.md CHANGED
@@ -1,11 +1,39 @@
1
- # @twin.org/logging-service - Changelog
1
+ # Changelog
2
2
 
3
- ## [0.0.3-next.2](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.3-next.1...logging-service-v0.0.3-next.2) (2026-03-02)
3
+ ## [0.0.3-next.4](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.3-next.3...logging-service-v0.0.3-next.4) (2026-05-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * update dependencies ([ed1e652](https://github.com/iotaledger/twin-logging/commit/ed1e652c4ba32c854d06e9def2f7f6db0bf9a7bd))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/logging-models bumped from 0.0.3-next.3 to 0.0.3-next.4
16
+
17
+ ## [0.0.3-next.3](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.3-next.2...logging-service-v0.0.3-next.3) (2026-05-11)
18
+
19
+
20
+ ### Features
21
+
22
+ * typescript 6 update ([cb28b05](https://github.com/iotaledger/twin-logging/commit/cb28b0557595d5ba9b25fab2d9f1222590787f5a))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @twin.org/logging-models bumped from 0.0.3-next.2 to 0.0.3-next.3
30
+
31
+ ## [0.0.3-next.2](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.3-next.1...logging-service-v0.0.3-next.2) (2026-03-02)
4
32
 
5
33
 
6
34
  ### Bug Fixes
7
35
 
8
- * api data types ([8d37cab](https://github.com/twinfoundation/logging/commit/8d37cab7ec759f079b6480bcc27d739357dbc392))
36
+ * api data types ([8d37cab](https://github.com/iotaledger/twin-logging/commit/8d37cab7ec759f079b6480bcc27d739357dbc392))
9
37
 
10
38
 
11
39
  ### Dependencies
@@ -14,24 +42,24 @@
14
42
  * dependencies
15
43
  * @twin.org/logging-models bumped from 0.0.3-next.1 to 0.0.3-next.2
16
44
 
17
- ## [0.0.3-next.1](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.3-next.0...logging-service-v0.0.3-next.1) (2025-11-10)
45
+ ## [0.0.3-next.1](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.3-next.0...logging-service-v0.0.3-next.1) (2025-11-10)
18
46
 
19
47
 
20
48
  ### Features
21
49
 
22
- * add context id features ([#33](https://github.com/twinfoundation/logging/issues/33)) ([38e982c](https://github.com/twinfoundation/logging/commit/38e982c9f009019fc02b67d919444b52657c9021))
23
- * add production release automation ([5dbcad8](https://github.com/twinfoundation/logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
24
- * add validate-locales ([df53f13](https://github.com/twinfoundation/logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
25
- * eslint migration to flat config ([1f9fdde](https://github.com/twinfoundation/logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
26
- * remove unused namespace ([7eb6575](https://github.com/twinfoundation/logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
27
- * update dependencies ([976fc06](https://github.com/twinfoundation/logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
28
- * update framework core ([aac823c](https://github.com/twinfoundation/logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
29
- * use shared store mechanism ([#20](https://github.com/twinfoundation/logging/issues/20)) ([bbacd31](https://github.com/twinfoundation/logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
50
+ * add context id features ([#33](https://github.com/iotaledger/twin-logging/issues/33)) ([38e982c](https://github.com/iotaledger/twin-logging/commit/38e982c9f009019fc02b67d919444b52657c9021))
51
+ * add production release automation ([5dbcad8](https://github.com/iotaledger/twin-logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
52
+ * add validate-locales ([df53f13](https://github.com/iotaledger/twin-logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
53
+ * eslint migration to flat config ([1f9fdde](https://github.com/iotaledger/twin-logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
54
+ * remove unused namespace ([7eb6575](https://github.com/iotaledger/twin-logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
55
+ * update dependencies ([976fc06](https://github.com/iotaledger/twin-logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
56
+ * update framework core ([aac823c](https://github.com/iotaledger/twin-logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
57
+ * use shared store mechanism ([#20](https://github.com/iotaledger/twin-logging/issues/20)) ([bbacd31](https://github.com/iotaledger/twin-logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
30
58
 
31
59
 
32
60
  ### Bug Fixes
33
61
 
34
- * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
62
+ * query params force coercion ([71c5329](https://github.com/iotaledger/twin-logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
35
63
 
36
64
 
37
65
  ### Dependencies
@@ -40,12 +68,12 @@
40
68
  * dependencies
41
69
  * @twin.org/logging-models bumped from 0.0.3-next.0 to 0.0.3-next.1
42
70
 
43
- ## [0.0.2-next.3](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.2-next.2...logging-service-v0.0.2-next.3) (2025-10-09)
71
+ ## [0.0.2-next.3](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.2-next.2...logging-service-v0.0.2-next.3) (2025-10-09)
44
72
 
45
73
 
46
74
  ### Features
47
75
 
48
- * add validate-locales ([df53f13](https://github.com/twinfoundation/logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
76
+ * add validate-locales ([df53f13](https://github.com/iotaledger/twin-logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
49
77
 
50
78
 
51
79
  ### Dependencies
@@ -54,12 +82,12 @@
54
82
  * dependencies
55
83
  * @twin.org/logging-models bumped from 0.0.2-next.2 to 0.0.2-next.3
56
84
 
57
- ## [0.0.2-next.2](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.2-next.1...logging-service-v0.0.2-next.2) (2025-08-29)
85
+ ## [0.0.2-next.2](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.2-next.1...logging-service-v0.0.2-next.2) (2025-08-29)
58
86
 
59
87
 
60
88
  ### Features
61
89
 
62
- * eslint migration to flat config ([1f9fdde](https://github.com/twinfoundation/logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
90
+ * eslint migration to flat config ([1f9fdde](https://github.com/iotaledger/twin-logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
63
91
 
64
92
 
65
93
  ### Dependencies
@@ -68,21 +96,21 @@
68
96
  * dependencies
69
97
  * @twin.org/logging-models bumped from 0.0.2-next.1 to 0.0.2-next.2
70
98
 
71
- ## [0.0.2-next.1](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.2-next.0...logging-service-v0.0.2-next.1) (2025-08-19)
99
+ ## [0.0.2-next.1](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.2-next.0...logging-service-v0.0.2-next.1) (2025-08-19)
72
100
 
73
101
 
74
102
  ### Features
75
103
 
76
- * add production release automation ([5dbcad8](https://github.com/twinfoundation/logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
77
- * remove unused namespace ([7eb6575](https://github.com/twinfoundation/logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
78
- * update dependencies ([976fc06](https://github.com/twinfoundation/logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
79
- * update framework core ([aac823c](https://github.com/twinfoundation/logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
80
- * use shared store mechanism ([#20](https://github.com/twinfoundation/logging/issues/20)) ([bbacd31](https://github.com/twinfoundation/logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
104
+ * add production release automation ([5dbcad8](https://github.com/iotaledger/twin-logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
105
+ * remove unused namespace ([7eb6575](https://github.com/iotaledger/twin-logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
106
+ * update dependencies ([976fc06](https://github.com/iotaledger/twin-logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
107
+ * update framework core ([aac823c](https://github.com/iotaledger/twin-logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
108
+ * use shared store mechanism ([#20](https://github.com/iotaledger/twin-logging/issues/20)) ([bbacd31](https://github.com/iotaledger/twin-logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
81
109
 
82
110
 
83
111
  ### Bug Fixes
84
112
 
85
- * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
113
+ * query params force coercion ([71c5329](https://github.com/iotaledger/twin-logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
86
114
 
87
115
 
88
116
  ### Dependencies
@@ -96,7 +124,7 @@
96
124
 
97
125
  ### Features
98
126
 
99
- * release to production ([3458161](https://github.com/twinfoundation/logging/commit/3458161b4bb530f86e4d1fe06123d885cdcb114d))
127
+ * release to production ([3458161](https://github.com/iotaledger/twin-logging/commit/3458161b4bb530f86e4d1fe06123d885cdcb114d))
100
128
 
101
129
 
102
130
  ### Dependencies
@@ -105,12 +133,12 @@
105
133
  * dependencies
106
134
  * @twin.org/logging-models bumped from ^0.0.0 to ^0.0.1
107
135
 
108
- ## [0.0.1-next.16](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.15...logging-service-v0.0.1-next.16) (2025-06-20)
136
+ ## [0.0.1-next.16](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.1-next.15...logging-service-v0.0.1-next.16) (2025-06-20)
109
137
 
110
138
 
111
139
  ### Bug Fixes
112
140
 
113
- * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
141
+ * query params force coercion ([71c5329](https://github.com/iotaledger/twin-logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
114
142
 
115
143
 
116
144
  ### Dependencies
@@ -119,12 +147,12 @@
119
147
  * dependencies
120
148
  * @twin.org/logging-models bumped from 0.0.1-next.15 to 0.0.1-next.16
121
149
 
122
- ## [0.0.1-next.15](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.14...logging-service-v0.0.1-next.15) (2025-06-12)
150
+ ## [0.0.1-next.15](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.1-next.14...logging-service-v0.0.1-next.15) (2025-06-12)
123
151
 
124
152
 
125
153
  ### Features
126
154
 
127
- * update dependencies ([976fc06](https://github.com/twinfoundation/logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
155
+ * update dependencies ([976fc06](https://github.com/iotaledger/twin-logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
128
156
 
129
157
 
130
158
  ### Dependencies
@@ -133,12 +161,12 @@
133
161
  * dependencies
134
162
  * @twin.org/logging-models bumped from 0.0.1-next.14 to 0.0.1-next.15
135
163
 
136
- ## [0.0.1-next.14](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.13...logging-service-v0.0.1-next.14) (2025-04-17)
164
+ ## [0.0.1-next.14](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.1-next.13...logging-service-v0.0.1-next.14) (2025-04-17)
137
165
 
138
166
 
139
167
  ### Features
140
168
 
141
- * use shared store mechanism ([#20](https://github.com/twinfoundation/logging/issues/20)) ([bbacd31](https://github.com/twinfoundation/logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
169
+ * use shared store mechanism ([#20](https://github.com/iotaledger/twin-logging/issues/20)) ([bbacd31](https://github.com/iotaledger/twin-logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
142
170
 
143
171
 
144
172
  ### Dependencies
@@ -147,7 +175,7 @@
147
175
  * dependencies
148
176
  * @twin.org/logging-models bumped from 0.0.1-next.13 to 0.0.1-next.14
149
177
 
150
- ## [0.0.1-next.13](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.12...logging-service-v0.0.1-next.13) (2025-03-28)
178
+ ## [0.0.1-next.13](https://github.com/iotaledger/twin-logging/compare/logging-service-v0.0.1-next.12...logging-service-v0.0.1-next.13) (2025-03-28)
151
179
 
152
180
 
153
181
  ### Miscellaneous Chores
package/docs/examples.md CHANGED
@@ -1 +1,101 @@
1
- # @twin.org/logging-service - Examples
1
+ # Logging Service Examples
2
+
3
+ Use these examples to route application logs through a configurable connector and query recent entries for troubleshooting.
4
+
5
+ ## LoggingService
6
+
7
+ ```typescript
8
+ import {
9
+ LoggingConnectorFactory,
10
+ type ILogEntry,
11
+ type ILoggingConnector
12
+ } from '@twin.org/logging-models';
13
+ import { LoggingService } from '@twin.org/logging-service';
14
+
15
+ class MemoryLoggingConnector implements ILoggingConnector {
16
+ private readonly entries: ILogEntry[] = [];
17
+
18
+ public className(): string {
19
+ return 'MemoryLoggingConnector';
20
+ }
21
+
22
+ public async log(logEntry: ILogEntry): Promise<void> {
23
+ this.entries.push(logEntry);
24
+ }
25
+
26
+ public async query(): Promise<{ entities: Partial<ILogEntry>[]; cursor?: string }> {
27
+ return {
28
+ entities: this.entries
29
+ };
30
+ }
31
+ }
32
+
33
+ LoggingConnectorFactory.register('logging', () => new MemoryLoggingConnector());
34
+
35
+ const service = new LoggingService();
36
+
37
+ const className = service.className();
38
+
39
+ await service.log({
40
+ level: 'warn',
41
+ source: 'worker-pool',
42
+ message: 'queueDepthHigh',
43
+ data: {
44
+ depth: 125,
45
+ threshold: 100
46
+ }
47
+ });
48
+ ```
49
+
50
+ ```typescript
51
+ import {
52
+ LoggingConnectorFactory,
53
+ type ILogEntry,
54
+ type ILoggingConnector
55
+ } from '@twin.org/logging-models';
56
+ import { LoggingService } from '@twin.org/logging-service';
57
+
58
+ class QueryableMemoryConnector implements ILoggingConnector {
59
+ private readonly entries: ILogEntry[] = [
60
+ {
61
+ level: 'error',
62
+ source: 'worker-pool',
63
+ ts: Date.now() - 2_000,
64
+ message: 'jobTimedOut'
65
+ },
66
+ {
67
+ level: 'info',
68
+ source: 'worker-pool',
69
+ ts: Date.now() - 1_000,
70
+ message: 'jobCompleted'
71
+ }
72
+ ];
73
+
74
+ public className(): string {
75
+ return 'QueryableMemoryConnector';
76
+ }
77
+
78
+ public async log(logEntry: ILogEntry): Promise<void> {
79
+ this.entries.push(logEntry);
80
+ }
81
+
82
+ public async query(): Promise<{ entities: Partial<ILogEntry>[]; cursor?: string }> {
83
+ return {
84
+ entities: this.entries
85
+ };
86
+ }
87
+ }
88
+
89
+ LoggingConnectorFactory.register('logging', () => new QueryableMemoryConnector());
90
+
91
+ const service = new LoggingService();
92
+
93
+ const queryResult = await service.query(
94
+ 'error',
95
+ 'worker-pool',
96
+ Date.now() - 60_000,
97
+ Date.now(),
98
+ 'cursor-21',
99
+ 20
100
+ );
101
+ ```
@@ -290,6 +290,7 @@
290
290
  "components": {
291
291
  "schemas": {
292
292
  "Error": {
293
+ "description": "Model to describe serialized error.",
293
294
  "type": "object",
294
295
  "properties": {
295
296
  "name": {
@@ -298,7 +299,7 @@
298
299
  },
299
300
  "message": {
300
301
  "type": "string",
301
- "description": "The message for the error."
302
+ "description": "The message for the error as an i18n key."
302
303
  },
303
304
  "source": {
304
305
  "type": "string",
@@ -320,10 +321,10 @@
320
321
  "required": [
321
322
  "name",
322
323
  "message"
323
- ],
324
- "description": "Model to describe serialized error."
324
+ ]
325
325
  },
326
326
  "LogEntry": {
327
+ "description": "Interface describing a log entry.",
327
328
  "type": "object",
328
329
  "properties": {
329
330
  "level": {
@@ -354,38 +355,32 @@
354
355
  "level",
355
356
  "source",
356
357
  "message"
357
- ],
358
- "description": "Interface describing a log entry."
358
+ ]
359
359
  },
360
360
  "LogLevel": {
361
+ "description": "The log levels.",
361
362
  "anyOf": [
362
363
  {
363
- "type": "string",
364
364
  "const": "info",
365
365
  "description": "Info."
366
366
  },
367
367
  {
368
- "type": "string",
369
368
  "const": "error",
370
369
  "description": "Error."
371
370
  },
372
371
  {
373
- "type": "string",
374
372
  "const": "warn",
375
373
  "description": "Warn."
376
374
  },
377
375
  {
378
- "type": "string",
379
376
  "const": "trace",
380
377
  "description": "Trace."
381
378
  },
382
379
  {
383
- "type": "string",
384
380
  "const": "debug",
385
381
  "description": "Debug."
386
382
  }
387
- ],
388
- "description": "The log levels."
383
+ ]
389
384
  },
390
385
  "LoggingListResponse": {
391
386
  "type": "object",
@@ -28,7 +28,7 @@ The options for the connector.
28
28
 
29
29
  ## Properties
30
30
 
31
- ### CLASS\_NAME
31
+ ### CLASS\_NAME {#class_name}
32
32
 
33
33
  > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
@@ -36,7 +36,7 @@ Runtime name for the class.
36
36
 
37
37
  ## Methods
38
38
 
39
- ### className()
39
+ ### className() {#classname}
40
40
 
41
41
  > **className**(): `string`
42
42
 
@@ -54,7 +54,7 @@ The class name of the component.
54
54
 
55
55
  ***
56
56
 
57
- ### log()
57
+ ### log() {#log}
58
58
 
59
59
  > **log**(`logEntry`): `Promise`\<`void`\>
60
60
 
@@ -80,7 +80,7 @@ Nothing.
80
80
 
81
81
  ***
82
82
 
83
- ### query()
83
+ ### query() {#query}
84
84
 
85
85
  > **query**(`level?`, `source?`, `timeStart?`, `timeEnd?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `ILogEntry`[]; `cursor?`: `string`; \}\>
86
86
 
@@ -4,9 +4,9 @@ Options for the logging service constructor.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### loggingConnectorType?
7
+ ### loggingConnectorType? {#loggingconnectortype}
8
8
 
9
- > `optional` **loggingConnectorType**: `string`
9
+ > `optional` **loggingConnectorType?**: `string`
10
10
 
11
11
  The type of the logging connector to use.
12
12
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/logging-service",
3
- "version": "0.0.3-next.2",
4
- "description": "Logging contract implementation and REST endpoint definitions",
3
+ "version": "0.0.3-next.4",
4
+ "description": "Exposes logging operations through service routes and API contracts for server-side integration.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/twinfoundation/logging.git",
7
+ "url": "git+https://github.com/iotaledger/logging.git",
8
8
  "directory": "packages/logging-service"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -17,7 +17,7 @@
17
17
  "@twin.org/api-models": "next",
18
18
  "@twin.org/core": "next",
19
19
  "@twin.org/entity": "next",
20
- "@twin.org/logging-models": "0.0.3-next.2",
20
+ "@twin.org/logging-models": "0.0.3-next.4",
21
21
  "@twin.org/nameof": "next",
22
22
  "@twin.org/web": "next"
23
23
  },
@@ -49,7 +49,7 @@
49
49
  "business-logic"
50
50
  ],
51
51
  "bugs": {
52
- "url": "git+https://github.com/twinfoundation/logging/issues"
52
+ "url": "git+https://github.com/iotaledger/logging/issues"
53
53
  },
54
54
  "homepage": "https://twindev.org"
55
55
  }