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

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,25 @@
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.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)
4
+
5
+
6
+ ### Features
7
+
8
+ * typescript 6 update ([cb28b05](https://github.com/iotaledger/twin-logging/commit/cb28b0557595d5ba9b25fab2d9f1222590787f5a))
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.2 to 0.0.3-next.3
16
+
17
+ ## [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
18
 
5
19
 
6
20
  ### Bug Fixes
7
21
 
8
- * api data types ([8d37cab](https://github.com/twinfoundation/logging/commit/8d37cab7ec759f079b6480bcc27d739357dbc392))
22
+ * api data types ([8d37cab](https://github.com/iotaledger/twin-logging/commit/8d37cab7ec759f079b6480bcc27d739357dbc392))
9
23
 
10
24
 
11
25
  ### Dependencies
@@ -14,24 +28,24 @@
14
28
  * dependencies
15
29
  * @twin.org/logging-models bumped from 0.0.3-next.1 to 0.0.3-next.2
16
30
 
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)
31
+ ## [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
32
 
19
33
 
20
34
  ### Features
21
35
 
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))
36
+ * add context id features ([#33](https://github.com/iotaledger/twin-logging/issues/33)) ([38e982c](https://github.com/iotaledger/twin-logging/commit/38e982c9f009019fc02b67d919444b52657c9021))
37
+ * add production release automation ([5dbcad8](https://github.com/iotaledger/twin-logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
38
+ * add validate-locales ([df53f13](https://github.com/iotaledger/twin-logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
39
+ * eslint migration to flat config ([1f9fdde](https://github.com/iotaledger/twin-logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
40
+ * remove unused namespace ([7eb6575](https://github.com/iotaledger/twin-logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
41
+ * update dependencies ([976fc06](https://github.com/iotaledger/twin-logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
42
+ * update framework core ([aac823c](https://github.com/iotaledger/twin-logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
43
+ * use shared store mechanism ([#20](https://github.com/iotaledger/twin-logging/issues/20)) ([bbacd31](https://github.com/iotaledger/twin-logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
30
44
 
31
45
 
32
46
  ### Bug Fixes
33
47
 
34
- * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
48
+ * query params force coercion ([71c5329](https://github.com/iotaledger/twin-logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
35
49
 
36
50
 
37
51
  ### Dependencies
@@ -40,12 +54,12 @@
40
54
  * dependencies
41
55
  * @twin.org/logging-models bumped from 0.0.3-next.0 to 0.0.3-next.1
42
56
 
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)
57
+ ## [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
58
 
45
59
 
46
60
  ### Features
47
61
 
48
- * add validate-locales ([df53f13](https://github.com/twinfoundation/logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
62
+ * add validate-locales ([df53f13](https://github.com/iotaledger/twin-logging/commit/df53f1331394f2f9333e91e4995a88dded90e484))
49
63
 
50
64
 
51
65
  ### Dependencies
@@ -54,12 +68,12 @@
54
68
  * dependencies
55
69
  * @twin.org/logging-models bumped from 0.0.2-next.2 to 0.0.2-next.3
56
70
 
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)
71
+ ## [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
72
 
59
73
 
60
74
  ### Features
61
75
 
62
- * eslint migration to flat config ([1f9fdde](https://github.com/twinfoundation/logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
76
+ * eslint migration to flat config ([1f9fdde](https://github.com/iotaledger/twin-logging/commit/1f9fddedfdcce9942afed431d9460a0f22092744))
63
77
 
64
78
 
65
79
  ### Dependencies
@@ -68,21 +82,21 @@
68
82
  * dependencies
69
83
  * @twin.org/logging-models bumped from 0.0.2-next.1 to 0.0.2-next.2
70
84
 
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)
85
+ ## [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
86
 
73
87
 
74
88
  ### Features
75
89
 
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))
90
+ * add production release automation ([5dbcad8](https://github.com/iotaledger/twin-logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
91
+ * remove unused namespace ([7eb6575](https://github.com/iotaledger/twin-logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
92
+ * update dependencies ([976fc06](https://github.com/iotaledger/twin-logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
93
+ * update framework core ([aac823c](https://github.com/iotaledger/twin-logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
94
+ * use shared store mechanism ([#20](https://github.com/iotaledger/twin-logging/issues/20)) ([bbacd31](https://github.com/iotaledger/twin-logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
81
95
 
82
96
 
83
97
  ### Bug Fixes
84
98
 
85
- * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
99
+ * query params force coercion ([71c5329](https://github.com/iotaledger/twin-logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
86
100
 
87
101
 
88
102
  ### Dependencies
@@ -96,7 +110,7 @@
96
110
 
97
111
  ### Features
98
112
 
99
- * release to production ([3458161](https://github.com/twinfoundation/logging/commit/3458161b4bb530f86e4d1fe06123d885cdcb114d))
113
+ * release to production ([3458161](https://github.com/iotaledger/twin-logging/commit/3458161b4bb530f86e4d1fe06123d885cdcb114d))
100
114
 
101
115
 
102
116
  ### Dependencies
@@ -105,12 +119,12 @@
105
119
  * dependencies
106
120
  * @twin.org/logging-models bumped from ^0.0.0 to ^0.0.1
107
121
 
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)
122
+ ## [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
123
 
110
124
 
111
125
  ### Bug Fixes
112
126
 
113
- * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
127
+ * query params force coercion ([71c5329](https://github.com/iotaledger/twin-logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
114
128
 
115
129
 
116
130
  ### Dependencies
@@ -119,12 +133,12 @@
119
133
  * dependencies
120
134
  * @twin.org/logging-models bumped from 0.0.1-next.15 to 0.0.1-next.16
121
135
 
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)
136
+ ## [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
137
 
124
138
 
125
139
  ### Features
126
140
 
127
- * update dependencies ([976fc06](https://github.com/twinfoundation/logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
141
+ * update dependencies ([976fc06](https://github.com/iotaledger/twin-logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
128
142
 
129
143
 
130
144
  ### Dependencies
@@ -133,12 +147,12 @@
133
147
  * dependencies
134
148
  * @twin.org/logging-models bumped from 0.0.1-next.14 to 0.0.1-next.15
135
149
 
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)
150
+ ## [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
151
 
138
152
 
139
153
  ### Features
140
154
 
141
- * use shared store mechanism ([#20](https://github.com/twinfoundation/logging/issues/20)) ([bbacd31](https://github.com/twinfoundation/logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
155
+ * use shared store mechanism ([#20](https://github.com/iotaledger/twin-logging/issues/20)) ([bbacd31](https://github.com/iotaledger/twin-logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
142
156
 
143
157
 
144
158
  ### Dependencies
@@ -147,7 +161,7 @@
147
161
  * dependencies
148
162
  * @twin.org/logging-models bumped from 0.0.1-next.13 to 0.0.1-next.14
149
163
 
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)
164
+ ## [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
165
 
152
166
 
153
167
  ### 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.3",
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.3",
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
  }