# @tsed/logger-std

> Stdout and Stderr appender module for @tsed/logger

Latest version **8.0.7** (published 2026-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tsed/logger-std
pnpm add @tsed/logger-std
yarn add @tsed/logger-std
bun add @tsed/logger-std
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.0.7 |
| Published | 2026-10-03 |
| First published | 2025-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 66 |
| Author | Romain Lenzotti |
| Maintainers | romakita |
| Keywords | ts, log, debug, typescript, trace |

## Links

- npm: https://www.npmjs.com/package/@tsed/logger-std
- Repository: https://github.com/tsedio/logger
- Homepage: https://github.com/tsedio/logger/tree/production/packages/logger-std
- Issues: https://github.com/tsedio/logger/issues
- npm.io page: https://npm.io/package/@tsed/logger-std

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) 2.8.1
- [colors](https://npm.io/package/colors.md) 1.4.0
- [semver](https://npm.io/package/semver.md) ^7.8.5
- [date-format](https://npm.io/package/date-format.md) ^4.0.14

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 8.0.7 (latest) — 2026-10-03
- 8.0.0-rc.1 (rc) — 2025-08-04
- 8.0.6 — 2026-10-03
- 8.0.5 — 2026-03-18
- 8.0.4 — 2025-08-19
- 8.0.3 — 2025-08-14
- 8.0.2 — 2025-08-14
- 8.0.1 — 2025-08-10
- 8.0.0 — 2025-08-09

## README

# @tsed/logger-std

[![Build Status](https://travis-ci.org/tsedio/logger.svg?branch=master)](https://travis-ci.org/tsedio/logger)
[![Coverage Status](https://coveralls.io/repos/github/tsedio/logger/badge.svg?branch=master)](https://coveralls.io/github/tsedio/logger?branch=master)
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.svg?v=100)](https://github.com/ellerbrock/typescript-badges/)
[![npm version](https://badge.fury.io/js/%40tsed%2Flogger-std.svg)](https://badge.fury.io/js/%40tsed%2Flogger-std)
[![Dependencies](https://david-dm.org/tsedio/logger.svg)](https://david-dm.org/tsedio/logger#info=dependencies)
[![img](https://david-dm.org/tsedio/logger/dev-status.svg)](https://david-dm.org/tsedio/logger/#info=devDependencies)
[![img](https://david-dm.org/tsedio/logger/peer-status.svg)](https://david-dm.org/tsedio/logger/#info=peerDependenciess)
[![Known Vulnerabilities](https://snyk.io/test/github/tsedio/logger/badge.svg)](https://snyk.io/test/github/tsedio/ts-express-decorators)

<p style="text-align: center" align="center">
 <a href="https://tsed.dev" target="_blank"><img src="https://tsed.dev/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
</p>

Stdout and Stderr appender module for [@tsed/logger](https://tsedio.github.io/logger/).

## Features

- Standard output (stdout) appender for info, debug, and trace level logs
- Standard error (stderr) appender for error, warn, and fatal level logs
- Configurable log message layout
- Easy integration with @tsed/logger

## Installation

```bash
npm install @tsed/logger-std
```

## Usage

### StdoutAppender

The StdoutAppender writes all log events to the standard output stream.

```typescript
import {Logger} from "@tsed/logger";
import {StdoutAppender} from "@tsed/logger-std";

const logger = new Logger("loggerName");

logger.appenders.set("stdout", {
  type: StdoutAppender,
  levels: ["info", "debug", "trace"]
});

logger.info("Hello world");
```

### StderrAppender

The StderrAppender writes all log events to the standard error stream.

```typescript
import {Logger} from "@tsed/logger";
import {StderrAppender} from "@tsed/logger-std";

const logger = new Logger("loggerName");

logger.appenders.set("stderr", {
  type: StderrAppender,
  levels: ["error", "warn", "fatal"]
});

logger.error("An error occurred");
```

### Using Both Appenders

You can use both appenders together to direct different log levels to the appropriate output streams:

```typescript
import {Logger} from "@tsed/logger";
import {StdoutAppender, StderrAppender} from "@tsed/logger-std";

const logger = new Logger("loggerName");

// Configure stdout for normal logging
logger.appenders.set("stdout", {
  type: StdoutAppender,
  levels: ["info", "debug", "trace"]
});

// Configure stderr for error logging
logger.appenders.set("stderr", {
  type: StderrAppender,
  levels: ["error", "warn", "fatal"]
});

logger.info("Normal operation"); // Goes to stdout
logger.error("Something went wrong"); // Goes to stderr
```

### Custom Layout

You can customize the output format by specifying a layout:

```typescript
import {Logger} from "@tsed/logger";
import {StdoutAppender} from "@tsed/logger-std";

const logger = new Logger("loggerName");

logger.appenders.set("stdout", {
  type: StdoutAppender,
  levels: ["info", "debug", "trace"],
  layout: {
    type: "pattern",
    pattern: "%d %p %c %m%n"
  }
});

logger.info("Custom formatted log");
```

## Configuration Options

Both StdoutAppender and StderrAppender accept the following configuration options:

- `type` - The appender type (StdoutAppender or StderrAppender)
- `levels` - Array of log levels to output through this appender
- `layout` - (optional) Layout configuration object, defaults to colored layout

## License

The MIT License (MIT)

Copyright (c) 2016 - 2023 Romain Lenzotti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/@tsed/logger-std · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
