Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Changes

Implements LoggerService in packages/api-core following the features-based architecture pattern. Provides structured logging via Pino with DI container integration.

Implementation

  • features/logger/: Complete feature implementation

    • abstractions.ts: ILoggerService interface with all log levels (fatal, error, warn, info, debug, trace)
    • LoggerService.ts: Pino wrapper with optional custom logger injection
    • feature.ts: DI container registration
    • index.ts: Public exports
  • Integration:

    • Added @webiny/logger dependency
    • Added package exports: @webiny/api-core/features/LoggerService
    • Registered in ApiCoreFeature
  • Tests: 17 test cases covering registration, custom logger config, all logging methods, child loggers, and DI integration

Usage

import { LoggerService } from "@webiny/api-core/features/LoggerService";

class MyService {
  constructor(private logger: LoggerService.Interface) {}
  
  doWork() {
    this.logger.info("Starting work");
    this.logger.info({ userId: "123" }, "User action");
    
    const child = this.logger.child({ requestId: "abc-123" });
    child.error({ error: err }, "Operation failed");
  }
}

How Has This Been Tested?

Unit tests with vitest covering feature registration, logging methods, and DI integration patterns.

Documentation

No user-facing documentation needed - follows existing internal feature patterns.

Original prompt

please go into packages/api-core and implement LoggerService... follow the features-based arch that is already laid out


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Implement LoggerService in packages/api-core Implement LoggerService feature in api-core Nov 25, 2025
Copilot AI requested a review from adrians5j November 25, 2025 13:13
Copilot finished work on behalf of adrians5j November 25, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants