# @slack/logger

> Logging utility used by Node Slack SDK

Latest version **5.0.0** (published 2026-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @slack/logger
pnpm add @slack/logger
yarn add @slack/logger
bun add @slack/logger
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-07-14 |
| First published | 2019-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 20 |
| Dependencies | 1 |
| Unpacked size | 13.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Slack Technologies, LLC |
| Maintainers | slackhq, ajm, sgorbach0v, stevegill, slack_biztech, misscoded, mwbrooks, cchensh, sspencer-slack, evegeris, e-zim, farhanjk |
| Keywords | slack, logging |

## Links

- npm: https://www.npmjs.com/package/@slack/logger
- Repository: https://github.com/slackapi/node-slack-sdk
- Homepage: https://docs.slack.dev/tools/node-slack-sdk/
- Issues: https://github.com/slackapi/node-slack-sdk/issues
- npm.io page: https://npm.io/package/@slack/logger

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) >=20

## 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

- 5.0.0 (latest) — 2026-07-14
- 5.0.0-rc.1 (rc) — 2026-05-13
- 4.0.1 — 2026-03-13
- 4.0.0 — 2023-08-25
- 3.0.0 — 2021-01-12
- 2.0.0 — 2019-10-09
- 1.1.1 — 2019-10-09
- 1.1.0 — 2019-09-25
- 1.0.0 — 2019-03-28

## README

# Slack Logger

[![codecov](https://codecov.io/gh/slackapi/node-slack-sdk/graph/badge.svg?token=OcQREPvC7r&flag=logger)](https://codecov.io/gh/slackapi/node-slack-sdk)

The `@slack/logger` package is intended to be used as a simple logging interface that supports verbosity levels.

## Requirements

This package supports Node v20 and higher. It's highly recommended to use [the latest LTS version of
node](https://github.com/nodejs/Release#release-schedule), and the documentation is written using syntax and features
from that version.

## Installation

```shell
$ npm install @slack/logger
```

## Usage

This package exports a `ConsoleLogger` class, a generic `Logger` interface and a `LogLevel` enum.
The source code is short (~150 lines of code), so check out `src/index.ts` for details, but the `ConsoleLogger` API
mimics the default node `console` API with three additions:

- `getLevel()`: returns the currently-specific `LogLevel` of the logger.
- `setLevel(LogLevel)`: sets the `LogLevel` of the logger.
- `setName(string)`: sets a prefix to display in logs. Useful if you have multiple loggers active.

### Example

This short snippet shows various `Logger` levels and customized labels:

```javascript
const { ConsoleLogger, LogLevel } = require("@slack/logger");

const logger = new ConsoleLogger();

logger.error("a problem happened");
logger.warn("might need attention");
logger.info("take note of this");
logger.debug("or dig into details");

logger.setName("HAL");
logger.setLevel(LogLevel.DEBUG);

logger.info("what an observation");
logger.debug("i am so interested");
```

When run, messages that match the following values are logged:

```txt
[ERROR]   a problem happened
[WARN]   might need attention
[INFO]   take note of this
[INFO]  HAL what an observation
[DEBUG]  HAL i am so interested
```

## Getting Help

If you get stuck, we're here to help. The following are the best ways to get assistance working through your issue:

- [Issue Tracker](http://github.com/slackapi/node-slack-sdk/issues) for questions, feature requests, bug reports and
  general discussion related to this package. Try searching before you create a new issue.
- [Email us](mailto:developers@slack.com) in Slack developer support: `developers@slack.com`

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