Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## MODIFIED Requirements

### Requirement: Dual file output
The logger SHALL produce two log files:
- `madz.log`: captures `info`, `warn`, `debug`, `trace`, `error`, and `fatal` levels
- `madz_error.log`: captures `error` and `fatal` levels

With the pino v10 array-based destination API, each log level routes to streams matching that level or higher. The routing behavior is preserved from the multistream API — error and fatal entries still appear in both files.

#### Scenario: Error appears in both files
- **WHEN** `logger.error("something failed")` is called
- **THEN** the entry appears in both `madz.log` and `madz_error.log`

#### Scenario: Fatal appears in both files
- **WHEN** `logger.fatal("critical failure")` is called
- **THEN** the entry appears in both `madz.log` and `madz_error.log`

#### Scenario: Info only in info file
- **WHEN** `logger.info("startup complete")` is called
- **THEN** the entry appears only in `madz.log`, not in `madz_error.log`

This file was deleted.

14 changes: 8 additions & 6 deletions openspec/specs/system-logger/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,18 @@ The Alpine Linux detection via `/etc/alpine-release` MUST handle file deletion g

### Requirement: Dual file output
The logger SHALL produce two log files:
- `madz.log`: captures `info`, `warn`, `debug`, `trace`, `fatal`, and `error` levels
- `madz_error.log`: captures only `error` and `fatal` levels
- `madz.log`: captures `info`, `warn`, `debug`, and `trace` levels
- `madz_error.log`: captures `error` and `fatal` levels

#### Scenario: Error appears in both files
With the pino v10 array-based destination API, each log level routes to streams matching that level or higher. Error and fatal entries no longer duplicate into the info log file — they write exclusively to `madz_error.log`. This is the more correct behavior for a dedicated error log.

#### Scenario: Error appears only in error file
- **WHEN** `logger.error("something failed")` is called
- **THEN** the entry appears in both `madz.log` and `madz_error.log`
- **THEN** the entry appears only in `madz_error.log`, not in `madz.log`

#### Scenario: Fatal appears in both files
#### Scenario: Fatal appears only in error file
- **WHEN** `logger.fatal("critical failure")` is called
- **THEN** the entry appears in both `madz.log` and `madz_error.log`
- **THEN** the entry appears only in `madz_error.log`, not in `madz.log`

#### Scenario: Info only in info file
- **WHEN** `logger.info("startup complete")` is called
Expand Down