[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/core](../../README) / [logger](../README) / StackChannel

# Class: StackChannel

Defined in: [logger/channels/StackChannel.ts:22](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/logger/channels/StackChannel.ts#L22)

Fans one entry out to several child channels at once — e.g. print to the
console *and* persist to a daily file from a single log call.

Writes are dispatched with `Promise.allSettled`, so one failing child channel
never stops the others from receiving the entry.

## Example

```ts
// config/logging.ts — "stack" references other channels by name
channels: {
  stack: { driver: "stack", channels: ["console", "daily"] },
  console: { driver: "console", format: "pretty" },
  daily: { driver: "daily", path: "./storage/logs", days: 7 },
}
```

## Implements

- [`LogChannel`](../interfaces/LogChannel)

## Constructors

### Constructor

> **new StackChannel**(`_channels`): `StackChannel`

Defined in: [logger/channels/StackChannel.ts:24](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/logger/channels/StackChannel.ts#L24)

#### Parameters

##### \_channels

[`LogChannel`](../interfaces/LogChannel)[]

The resolved child channels to broadcast each entry to.

#### Returns

`StackChannel`

## Methods

### write()

> **write**(`entry`): `Promise`\<`void`\>

Defined in: [logger/channels/StackChannel.ts:26](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/logger/channels/StackChannel.ts#L26)

#### Parameters

##### entry

[`LogEntry`](../interfaces/LogEntry)

#### Returns

`Promise`\<`void`\>

#### Implementation of

[`LogChannel`](../interfaces/LogChannel).[`write`](../interfaces/LogChannel#write)
