Skip to content

Conversation

@ozsay
Copy link
Contributor

@ozsay ozsay commented Feb 4, 2026

Note

Description

Adds a new base44 logs command that provides unified log viewing for Base44 applications. The command fetches and displays both app-level audit logs (entity operations, function calls, auth events, user management) and function execution logs in a single view. Users can filter by specific functions, log levels, time ranges, and export results as JSON for programmatic access.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added base44 logs command with comprehensive filtering options (--function, --level, --since, --until, --limit, --order, --json)
  • Implemented unified log display combining app audit logs and function execution logs
  • Created core logs module (src/core/logs/) with API client, Zod schemas, and workspace ID resolution
  • Added function logs API support (src/core/resources/function/api.ts, fetchFunctionLogs())
  • Refactored functions command structure to use parent command pattern (consolidation)
  • Added comprehensive test coverage with 11+ test cases for logs command and functions logs
  • Extended testkit with API mocking for audit logs and function logs endpoints
  • Implemented human-readable table formatting with color-coded log levels and timestamps

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

Command Usage:

base44 logs                           # Show all app + function logs
base44 logs --function my-func        # Show logs for specific function(s)
base44 logs --level error             # Filter by log level
base44 logs --since 2024-01-01        # Filter by time range
base44 logs --json                    # Output as JSON

Architecture:

  • Follows established CLI patterns (factory functions, CLIContext injection, runCommand/runTask wrappers)
  • Uses structured error handling with InvalidInputError for validation
  • Implements Zod schemas for API response validation
  • Audit logs require workspace ID lookup (getWorkspaceId()) before fetching
  • Function logs are fetched per-function and merged with audit logs for unified view

🤖 Generated by Claude | 2026-02-05 09:45 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.28-pr.193.a9c5c3a

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.28-pr.193.a9c5c3a"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.28-pr.193.a9c5c3a"
  }
}

Preview published to npm registry — try new features instantly!

- Shorten timestamp to readable format (YYYY-MM-DD HH:MM:SS)
- Adjust column widths for better alignment
- Dim the timestamp for visual hierarchy

Co-authored-by: Cursor <cursoragent@cursor.com>
@claude
Copy link

claude bot commented Feb 4, 2026

Code review

Found 1 issue to address:

CLAUDE.md Documentation Missing

The PR adds a new logs/ module under src/core/ with schema, API, and core functionality, but CLAUDE.md is not updated to document this architectural change.

CLAUDE.md Rule (line 659):

"Keep AGENTS.md updated - Update this file when architecture changes"

What needs updating:

  1. Folder structure section (lines 32-140) should include the new logs/ module:

    ├── core/
    │   ├── logs/                 # Audit logs (NEW)
    │   │   ├── schema.ts         # Zod schemas for audit log types
    │   │   ├── api.ts            # API functions for fetching logs
    │   │   └── index.ts
    
  2. Module documentation - Consider adding a "Logs Module" section similar to the Site Module documentation that explains:

    • Architecture overview
    • Key functions (fetchAuditLogs(), getWorkspaceId())
    • Workspace-level vs app-level logs
    • CLI command usage

This documentation helps AI agents understand the logs architecture when working on related features.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ozsay ozsay changed the title Add base44 logs command feat: Add base44 logs command Feb 4, 2026
@claude
Copy link

claude bot commented Feb 4, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@claude
Copy link

claude bot commented Feb 4, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

The PR correctly implements the base44 logs command following all established patterns in the codebase.

@ozsay ozsay marked this pull request as draft February 5, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant