Skip to content

Logs sent via client.app.log() are not visible with --print-logs #7301

Closed as not planned

Description

@rqdmap

Description

According to the official documentation at https://opencode.ai/docs/plugins/#logging, plugins should use client.app.log() for structured logging. However, logs sent via client.app.log() are not visible in the console, even when using --print-logs --log-level DEBUG flags.

Plugins

No response

OpenCode version

1.0.220

Steps to reproduce

  1. Create Test Plugin: ~/.config/opencode/plugin/test-logging.js
export const TestLoggingPlugin = async ({ client }) => {
  return {
    event: async ({ event }) => {
      if (event.type === "session.created") {
        console.log("✅ [console.log] Session created")
        
        await client.app.log({
          service: "test-logging",
          level: "info",
          message: "✅ [client.app.log] Session created",
          extra: { sessionId: event.properties?.info?.id }
        })
      }
    }
  }
}
  1. Start OpenCode: opencode serve --port 64595 --print-logs --log-level DEBUG
  2. Connect OpenCode Server opencode attach localhost:64595 and create a new session
  3. Observe Log Output. After creating a session:
✅ [console.log] Session created
INFO  2026-01-08T08:32:08 +2ms service=server status=started method=POST path=/log request
...

Screenshot and/or share link

Image

Operating System

macOs Sequoia 15.6

Terminal

Alacritty

Activity

  1. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  2. remvn commented on Apr 16, 2026

    @remvn

    I think you need to view logs from .local/share/opencode/log

  3. removed
    bugSomething isn't working
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions