-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
- 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 }
})
}
}
}
}
- Start OpenCode:
opencode serve --port 64595 --print-logs --log-level DEBUG - Connect OpenCode Server
opencode attach localhost:64595and create a new session - 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
Operating System
macOs Sequoia 15.6
Terminal
Alacritty
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working