-
Notifications
You must be signed in to change notification settings - Fork 5.4k
refactor: Standardize Logging Across Core, CLI, and Server #6169
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
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
…mproved clarity and consistency
…eprecated options
…pdate logging format across plugin bootstrap
…ved structure and clarity
8eeb0fe to
f34527b
Compare
…oved consistency and clarity
…s across packages for improved consistency
…s across multiple packages for improved linting consistency
…nd utilities for improved consistency and clarity
…sistency and improved clarity
wtfsayo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm; def will help with debugging
0xbbjoker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Claude finished @standujar's task —— View job PR Review: Standardize Logging Across Core, CLI, and ServerTodo List
Review Results✅ APPROVED - Well-executed logging standardizationThis PR successfully implements comprehensive logging standardization across the ElizaOS codebase with proper structure and safety measures. Key Strengths✅ Comprehensive Test Coverage: 420 lines of tests in ✅ Security Implementation: Robust data redaction using ✅ Proper Tool Usage: All packages correctly use ✅ TypeScript Quality: Strong typing throughout with no ✅ ESLint Rule: Well-implemented custom rule enforcing structured logging format with proper validation and clear error messages Implementation QualityLogger Architecture:
Plugin Migration Pattern: // Correct runtime.logger usage seen in task.ts:61-78
this.runtime.logger.debug({
src: 'plugin:bootstrap:service:task',
agentId: this.runtime.agentId
}, 'Validating repeating test task');ESLint Enforcement: Custom
Minor Observations📝 CLI Package: Still has 📝 Breaking Changes: None detected - this is purely internal refactoring maintaining backward compatibility Final AssessmentThis PR demonstrates excellent engineering practices:
The 2 existing approvals are well-justified. This standardization will significantly improve debugging capabilities and log management across the ElizaOS ecosystem. Recommendation: ✅ MERGE |
|
Claude encountered an error —— View job PR Review: Standardize Logging Across Core, CLI, and Server
|
c3e367c to
d907300
Compare
|
Claude finished @standujar's task —— View job PR Review: Standardize Logging Across Core, CLI, and ServerTodo List
Review Results✅ APPROVED - Well-executed logging standardizationThis PR successfully implements comprehensive logging standardization across the ElizaOS codebase with proper structure and safety measures. Key Strengths✅ Comprehensive Test Coverage: 420 lines of tests in ✅ Security Implementation: Robust data redaction using ✅ Proper Tool Usage: All packages correctly use ✅ TypeScript Quality: Strong typing throughout with no ✅ ESLint Rule: Well-implemented custom rule enforcing structured logging format with proper validation and clear error messages Implementation QualityLogger Architecture:
Plugin Migration Pattern: // Correct runtime.logger usage seen in task.ts:61-78
this.runtime.logger.debug({
src: 'plugin:bootstrap:service:task',
agentId: this.runtime.agentId
}, 'Validating repeating test task');ESLint Enforcement: Custom
Minor Observations📝 CLI Package: Still has 📝 Breaking Changes: None detected - this is purely internal refactoring maintaining backward compatibility Final AssessmentThis PR demonstrates excellent engineering practices:
The 2 existing approvals are well-justified. This standardization will significantly improve debugging capabilities and log management across the ElizaOS ecosystem. Recommendation: ✅ MERGE |
- Fixed serversToCheck -> messageServersToCheck (line 178) - Fixed serverId -> messageServerId (line 621)
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Refactored tests to spy on the correct logger instance in plugin-bootstrap service tests and updated logger.warn calls in auth-middleware tests to use a more descriptive log message format. These changes improve test accuracy and log message clarity.
|
Claude finished @standujar's task —— View job PR Review: Standardize Logging Across Core, CLI, and ServerTodo List
Review Results✅ APPROVED - Well-executed logging standardizationThis PR successfully implements comprehensive logging standardization across the ElizaOS codebase with proper structure and safety measures. Key Strengths✅ Comprehensive Test Coverage: 420 lines of tests in ✅ Security Implementation: Robust data redaction using ✅ Proper Tool Usage: All packages correctly use ✅ TypeScript Quality: Strong typing throughout with no ✅ ESLint Rule: Well-implemented custom rule enforcing structured logging format with proper validation and clear error messages Implementation QualityLogger Architecture:
Plugin Migration Pattern: // Correct runtime.logger usage seen in task.ts:61-78
this.runtime.logger.debug({
src: 'plugin:bootstrap:service:task',
agentId: this.runtime.agentId
}, 'Validating repeating test task');ESLint Enforcement: Custom
Minor Observations📝 CLI Package: Still has 📝 Breaking Changes: None detected - this is purely internal refactoring maintaining backward compatibility Final AssessmentThis PR demonstrates excellent engineering practices:
The 2 existing approvals are well-justified. This standardization will significantly improve debugging capabilities and log management across the ElizaOS ecosystem. Recommendation: ✅ MERGE |

Summary
Complete overhaul of the ElizaOS logging system. All logs now use a unified structured format with:
runtime.loggerfor plugins/agents[SRC] message (key=val, key=val)agentIdand more info for filteringKey Features
runtime.loggerwith Adze NamespacePlugins now use
runtime.loggerinstead of the global logger:The
#agentNamenamespace is automatically added by Adze.Compact Pretty Mode
Readable format in development - everything on one line:
JSON Mode with
agentIdIn production (
LOG_JSON_FORMAT=true), structured format for filtering:{ "level": "info", "time": 1732723200000, "src": "plugin:bootstrap:service:task", "agentId": "agent-123-uuid", "taskName": "myTask", "msg": "Executing task" }Changes
ESLint Configuration
@elizaos/structured-loggingrule to enforce format@elizaos/configdependencyMigrated Packages
srcFormatloggercore:<module>loggerhttp,ws,db,service:<name>loggercli:<command>,cli:util:<name>runtime.loggerplugin:sqlruntime.loggerplugin:bootstrap:service:<name>,plugin:bootstrap:provider:<name>Patterns by Component
Benefits
#agentNamevisible in all agent logsagentIdin every log for prod filteringTest Plan
@elizaos/structured-loggingviolations[SRC] message (extras)format validatedagentIdpresent in every agent logBreaking Changes
None. Internal refactor only.