dsh-logger-channels: Providing Visible Log Exits for DSH Profiles

Introduction

When running profiles in DeepSeek Harness (DSH), the framework and various plugins write logs via ctx.logger. However, the host default often only includes an in-memory sink, meaning the full output is invisible to operations staff. Troubleshooting startup failures, plugin behavior, or runtime issues often requires guessing or modifying code to add print statements, which is costly and non-reusable.

Below is an introduction to the community plugin dsh-logger-channels (Maintainer: xuan25, Category: Client). It does not alter business logic; it only registers named stderr, stdout, or size-rotated file channels to deliver logs from the framework and all plugins via ctx.logger to locations directly visible to operators.

What is this

dsh-logger-channels is an out-of-tree plugin attached to the DSH profile. In short: it provides the profile with a visible log sink—named channels receive every ctx.logger record from the framework and all plugins, preventing logs from getting stuck in the host’s memory buffer.

The plugin itself does not provide a tool interface nor does it come with an independent configuration file; channels are declared via process environment variables and/or the cordis configuration layer. The current package version is 0.1.0, depending on @deepseek-ai/cordis (>=4.0.1), and is licensed under MIT.

Core Features

Verified via the README, the capabilities are as follows:

  1. Named Channels: stderr, stdout, and size-rotated files; each channel can set its own level threshold.
  2. Fixed Line Format: Each record is one line, with fields ordered as: UTC timestamp, #sn (sequence number reset on each startup), level, logger name, and body.
  3. Layered Configuration: Built-in defaults → LOGGER_CHANNELS_* environment variables → cordis patch (config.channels for dsh-logger-channels); for the same key, config > env > default.
  4. File Rotation: When exceeding maxBytes, it renames generations (.1 is the newest) and retains keep generations; upon opening, it continues counting based on the existing file size, ensuring rotation remains continuous after a restart.
  5. Startup Status: When at least one channel is declared, the plugin logs an INFO line listing the names and thresholds of each channel.

Level numbers follow the cordis verbosity ladder (not the log4j/Python severity ordering): ERROR=0, INFO=1, WARN=2, DEBUG=3; MINLEVEL / minLevel indicates “output this level and anything more verbose,” with a default threshold of 2 (including warn and higher verbosity).

Installation and Activation

First, perform installation: execute the official command on the target profile (do not manually concatenate github:owner/repo):

dsh plugin --profile <name> add dsh-logger-channels

After installation, write config.channels for the plugin ID dsh-logger-channels via environment variables and/or in cordis.patch.yml (profile level, ~/.dsh/cordis.patch.yml, or overridden via --patch). Configuration errors (unknown channel type, missing path for file, out-of-bounds values, etc.) will cause failure during the apply phase, and the profile will not start.

The plugin runs with the permissions of the current dsh process; it is recommended to read the source code at the GitHub repository before installation and confirm that the MIT license meets your compliance requirements.

Typical Usage

Declaring Channels via Environment Variables

Each channel must first have LOGGER_CHANNELS_<NAME>_TYPE (<NAME> contains only uppercase letters and numbers; the channel name is its lowercase form, matching ^[a-z][a-z0-9-]{0,31}$). Other keys are attached to the declared channel and are optional.

Example (File channel, debug verbosity and above):

LOGGER_CHANNELS_APP_TYPE=file
LOGGER_CHANNELS_APP_PATH=/<path>
LOGGER_CHANNELS_APP_MINLEVEL=3

Summary of common variables:

Variable Required Description
LOGGER_CHANNELS_<NAME>_TYPE Yes stderr, stdout, or file
LOGGER_CHANNELS_<NAME>_PATH Required for file Output path (parent directories are created automatically)
LOGGER_CHANNELS_<NAME>_MINLEVEL No 0–3, default 2
LOGGER_CHANNELS_<NAME>_COLORS No false or 1–3, default false
LOGGER_CHANNELS_<NAME>_MAXLENGTH No Single line truncation character count, default 10240
LOGGER_CHANNELS_<NAME>_MAXBYTES No File rotation threshold (bytes), default 10485760
LOGGER_CHANNELS_<NAME>_KEEP No Number of rotation generations to keep, default 5

Keys on names without a declared TYPE will be ignored; lowercase segments (e.g., LOGGER_CHANNELS_app_TYPE) will not match any channel.

cordis Patch Layer

Optionally, write the channels mapping in the patch (keys are optional). Note: The patch replaces the entire config section for that plugin entry; it does not perform a deep merge; when changing only one field, you need to write out all fields that still need to be preserved.

- id: dsh-logger-channels
  config:
    channels:
      app:
        channel: file
        path: /<path>
        minLevel: 3

Channels from both layers are combined as a union; for the same attribute of the same channel, the config layer takes precedence.

Log Line Example

[2026-10-11T08:01:02.123Z] #42 INFO app Processing: scope=c2c peerId=1

If the first argument in the body is an Error, the stack trace will be rendered; the excess length is limited by the channel’s maxLength.

Use Cases and Notes

Suitable for: Developers and operations personnel who need to stably view DSH and plugin runtime logs in the terminal or files; multi-channel splitting (e.g., viewing errors on stderr, keeping full debug logs in a file).

Notes:

  • stdout is a shared stream: If the profile uses stdout to carry structured protocols, do not configure the stdout channel; the operator should coordinate stream ownership independently.
  • Write failures are not thrown to the host: If a channel cannot be written due to permissions, disk full, or rotation failure, it will silently discard subsequent writes, while other channels continue normally; if the disk is full, there will be no output from that channel—you should check file modification times rather than just looking at the log stream.
  • No channels means no additional sink behavior: A visible outlet and startup status line only exist after at least one channel is declared.

The DSH ecosystem emphasizes “Everything as a Plugin”; the SkillHub directory page is a community site with no official affiliation with DeepSeek or High-Flyer.

Conclusion

dsh-logger-channels connects ctx.logger from the memory side to stderr, stdout, or rotated files. Configuration is centralized in environment variables and cordis patches, making it suitable as a standard logging outlet for profiles.

  • Directory Page: https://www.skillhub.cn/plugins/xuan25/dsh-logger-channels
  • Source Code and Documentation: https://github.com/xuan25/dsh-logger-channels
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye