You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/website/content/docs/runtime/logging.mdx
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,18 @@ schemaType: HowTo
6
6
7
7
## Overview
8
8
9
-
QVAC provides two complementary logging primitives:
9
+
QVAC provides three complementary logging primitives:
10
10
11
-
-`loggingStream()`: stream real-time logs emitted by the SDK server and native addons (llamacpp, whispercpp, etc.). You decide what to do with each log line (print, persist, filter).
11
+
-`subscribeServerLogs()`: subscribe to **every** server-side log (SDK server, all loaded models, RAG) through a single stream, without tracking individual stream IDs. Returns an unsubscribe function.
12
+
-`loggingStream()`: stream real-time logs for a **single** source — the SDK server (`SDK_LOG_ID`) or one model (its model ID). You decide what to do with each log line (print, persist, filter).
12
13
-`getLogger()`: create a logger for your own application code (namespaced, configurable level, optional transports).
13
14
14
15
## Functions
15
16
16
17
1.[`getLogger()`](/reference/api) — create a logger
17
18
2.[`loadModel()`](/reference/api#loadmodel) — pass logger via `logger` option
18
-
3.[`loggingStream()`](/reference/api#loggingstream) — stream real-time logs from models or SDK server
19
+
3.[`loggingStream()`](/reference/api#loggingstream) — stream real-time logs from a single model or the SDK server
20
+
4.[`subscribeServerLogs()`](/reference/api#subscribeserverlogs) — stream all server-side logs through one subscription
19
21
20
22
For how to use each function, see [SDK — API reference](/reference/api/).
21
23
@@ -33,10 +35,12 @@ For how to use each function, see [SDK — API reference](/reference/api/).
33
35
34
36
## Features
35
37
36
-
***Streaming API (`loggingStream`)** — Consume real-time logs programmatically. Stream either:
38
+
***Streaming API (`loggingStream`)** — Consume real-time logs from one source programmatically. Stream either:
37
39
- SDK server logs using `SDK_LOG_ID`, or
38
40
- per-model addon logs using the model ID returned by `loadModel()`.
39
41
42
+
***Global subscription (`subscribeServerLogs`)** — Receive every server-side log (SDK server, all models, RAG) through a single subscription, without knowing the stream IDs ahead of time. The handler is called once per log line, and each log carries its origin in `log.id` (`SDK_LOG_ID`, a model ID, or a RAG workspace key) so you can still tell the sources apart. It is built on `loggingStream` and the reserved `SDK_ALL_LOG_ID` stream that the worker fans all logs into. The call returns an `unsubscribe()` function — invoke it to stop receiving logs.
43
+
40
44
***Logger API (`getLogger`)** — Create loggers for your application code with custom transports. Console output enabled by default; set `enableConsole: false` to use only custom transports.
41
45
42
46
It works for all model types (LLM, Whisper, NMT, Embeddings) and provides valuable insight into model performance and behavior.
@@ -69,6 +73,26 @@ The following script shows an example of streaming logs from loaded models:
69
73
</Tab>
70
74
</Tabs>
71
75
76
+
To capture logs from every source (SDK server, all models, RAG) with a single subscription, use `subscribeServerLogs`:
**Tip:** all examples throughout this documentation are self-contained and runnable. For instructions on how to run them, see [SDK quickstart](/quickstart).
0 commit comments