-
Notifications
You must be signed in to change notification settings - Fork 64
docs(cli): document operational process logging config #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 9 commits into
NVIDIA:main
from
ericevans-nv:docs/cli-operational-logging
Jul 16, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d5f2b67
docs(cli): document operational process logging config
ericevans-nv 2cc0bdc
docs(cli): document max_queue_capacity and queue_capacity bound
ericevans-nv ccc0204
docs(cli): document logging configuration sources
ericevans-nv e7596bd
Merge upstream/main into docs/cli-operational-logging
ericevans-nv fc992b7
Merge upstream/main into docs/cli-operational-logging
ericevans-nv 2e8e7c2
docs: add operational logging guide
ericevans-nv 4df0bbe
Merge remote-tracking branch 'upstream/main' into docs/cli-operationa…
ericevans-nv eca5e9b
docs: move operational logging guide to reference
ericevans-nv fd23a28
Merge remote-tracking branch 'upstream/main' into docs/cli-operationa…
ericevans-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| --- | ||
| title: "Operational Logging" | ||
| description: "Configure NeMo Relay operational logs through CLI options, environment variables, TOML, or Rust APIs." | ||
| position: 4 | ||
| --- | ||
| {/* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 */} | ||
|
|
||
| Operational logging records diagnostics about the Relay process, including | ||
| startup, configuration, plugins, gateway behavior, and runtime failures. It is | ||
| separate from agent observability through ATOF, ATIF, OpenTelemetry, or | ||
| OpenInference. | ||
|
|
||
| Relay writes operational logs to stderr. Optional file sinks receive additional | ||
| copies of those records. Each record includes a root Relay ID for correlation. | ||
|
|
||
| ## Defaults | ||
|
|
||
| Without configuration, Relay uses: | ||
|
|
||
| - `info` as the minimum log level | ||
| - Human-readable stderr output | ||
| - No file sinks | ||
|
|
||
| ## Choose a Configuration Source | ||
|
|
||
| Use the source that matches how Relay is launched: | ||
|
|
||
| | Use Case | Configuration Source | | ||
| | --- | --- | | ||
| | Run the Relay CLI with temporary settings | `--log-*` options | | ||
| | Configure a process without a Relay config file | `NEMO_RELAY_LOG*` environment variables | | ||
| | Reuse logging settings across runs | `[logging]` in TOML | | ||
| | Embed Relay in a Rust application | `LoggingConfig` and `LoggingRuntime` | | ||
|
|
||
| For CLI processes, Relay selects one source in this order: | ||
|
|
||
| 1. `--log-*` options or `--log-config-path` | ||
| 2. `NEMO_RELAY_LOG*` environment variables | ||
| 3. `[logging]` in the resolved Relay `config.toml` | ||
| 4. Built-in defaults | ||
|
|
||
| Sources are selected rather than merged. Rust applications explicitly choose | ||
| which `LoggingRuntime` initialization method to use and do not apply the CLI | ||
| precedence rules. | ||
|
|
||
| ## CLI Options | ||
|
|
||
| Configure the minimum level and stderr format directly: | ||
|
|
||
| ```bash | ||
| nemo-relay --log-level debug --log-stderr-format jsonl | ||
| ``` | ||
|
|
||
| Use an absolute TOML path when file sinks or other logging settings are needed: | ||
|
|
||
| ```bash | ||
| nemo-relay --log-config-path /absolute/path/to/logging.toml | ||
| ``` | ||
|
|
||
| Do not combine `--log-config-path` with `--log-level` or | ||
| `--log-stderr-format`. | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| Set these variables for the CLI or a Rust application that initializes logging | ||
| with `LoggingRuntime::configure_from_environment()`: | ||
|
|
||
| ```bash | ||
| export NEMO_RELAY_LOG=debug | ||
| export NEMO_RELAY_LOG_STDERR_FORMAT=jsonl | ||
| ``` | ||
|
|
||
| Supported values are: | ||
|
|
||
| - `NEMO_RELAY_LOG`: `error`, `warn`, `info`, `debug`, or `trace` | ||
| - `NEMO_RELAY_LOG_STDERR_FORMAT`: `human` or `jsonl` | ||
|
|
||
| Alternatively, select an absolute TOML file: | ||
|
|
||
| ```bash | ||
| export NEMO_RELAY_LOG_CONFIG_PATH=/absolute/path/to/logging.toml | ||
| ``` | ||
|
|
||
| `NEMO_RELAY_LOG_CONFIG_PATH` cannot be combined with the other logging | ||
| environment variables. | ||
|
|
||
| ## TOML Configuration | ||
|
|
||
| Logging settings use a `[logging]` table: | ||
|
|
||
| ```toml | ||
| [logging] | ||
| level = "info" | ||
| stderr_format = "human" | ||
| flush_interval_millis = 1000 | ||
|
|
||
| [[logging.sinks]] | ||
| path = ".nemo-relay/logs/relay.log.jsonl" | ||
| format = "jsonl" | ||
| level = "debug" | ||
| queue_capacity = 1024 | ||
| ``` | ||
|
|
||
| File sink paths are resolved relative to the process working directory. File | ||
| sinks use asynchronous queues, and `queue_capacity` cannot exceed 8,192 entries | ||
| per sink. | ||
|
|
||
| ## Rust Library API | ||
|
|
||
| Initialize operational logging once during application startup by choosing one | ||
| of these public APIs: | ||
|
|
||
| - `LoggingRuntime::configure(config)` for a constructed `LoggingConfig` | ||
| - `LoggingRuntime::configure_from_environment()` for environment configuration | ||
| - `LoggingRuntime::configure_from_file_path(path)` for an absolute TOML path | ||
|
|
||
| For example: | ||
|
|
||
| ```rust | ||
| let _logging_runtime = | ||
| nemo_relay::logging::LoggingRuntime::configure_from_environment()?; | ||
| ``` | ||
|
|
||
| Keep the returned runtime alive until application shutdown so pending file | ||
| records can be flushed. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.