Skip to content

File and stdout logger ​

Write DSH logs to stdout or files per logger.

@lukstei/dsh-log

What it does ​

  • Sends DSH logger output to stdout, to files, or both.
  • Sets a level threshold per logger and per destination, from silenced to DEBUG.
  • Lets you keep a persistent file log of only the loggers you care about.

How to use ​

  1. Install the plugin. The shipped patch logs INFO to stdout.
  2. Override file-log in your profile cordis.patch.yml to add a file output or change levels.
  3. Restart DSH and read the log file.
yaml
- id: file-log
  config:
    outputs:
      - target: stdout
        levels: { default: 2 }
      - target: file
        filePath: ~/.dsh/logs/dsh.log
        levels: { default: -1, tools: 3 }

Levels: -1 silenced, 0 ERROR, 1 WARN, 2 INFO, 3 DEBUG. default is the catch-all. With default: -1 plus named loggers you get an include list. Lines look like <ISO timestamp> [<LEVEL>] [<logger>] <message>.

Settings you might change ​

The outputs list is the only setting. Each entry has target (stdout or file), filePath (file only, ~ expands) and levels. Details are in the package README.

Works with ​

No other plugins needed. You need write access to every configured filePath.

Good to know ​

  • If DSH already prints logs to the console, a stdout output duplicates them.
  • No rotation or size limit on log files.
  • File write errors are silent.
  • Model Experience: adds nothing to the agent's context.

Install ​

sh
dsh plugin --profile <web|desktop> add @lukstei/dsh-log

Released under the MIT License.