Skip to content

Respect logging.output at startup and avoid counting discovery cancellation as endpoint failure #179

@sg-shag

Description

@sg-shag

Summary

Observed two operational issues while running Olla behind frontend/edge services:

  1. logging.output from config was not applied during startup because logger initialization happened before config load.
  2. Discovery cancellation during coordinated shutdown/restart (context.Canceled) was treated as a regular discovery failure, which could incorrectly contribute to failure state.

Expected behavior

  • Logger should honor configured logging.output path/stream at startup.
  • Discovery cancellation caused by lifecycle shutdown should be treated as expected and not counted as endpoint failure.

Proposed changes

  • Load config before logger initialization in main.go, and build logger settings from loaded config.
  • Add explicit logger OutputPath handling for absolute/relative output file targets.
  • In discovery service, short-circuit context.Canceled and skip failure-count increment/disable path for that case.
  • Add test coverage proving cancellation does not increment failures or disable endpoint.

Files touched

  • main.go
  • internal/logger/logger.go
  • internal/adapter/discovery/service.go
  • internal/adapter/discovery/service_test.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions