# @abtnode/logger

> ABT Node logger lib

Latest version **1.17.12** (published 2026-04-22) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.17.12 |
| Published | 2026-04-22 |
| First published | 2020-08-14 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 12.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | polunzh |
| Maintainers | wangshijun, polunzh, mave99a |
| Keywords | logger, lib |

## Links

- npm: https://www.npmjs.com/package/@abtnode/logger
- Repository: https://github.com/ArcBlock/blocklet-server
- Homepage: https://github.com/ArcBlock/blocklet-server#readme
- Issues: https://github.com/ArcBlock/blocklet-server/issues
- npm.io page: https://npm.io/package/@abtnode/logger

## Dependencies (10)

- [debug](https://npm.io/package/debug.md) ^4.4.1
- [morgan](https://npm.io/package/morgan.md) ^1.10.0
- [winston](https://npm.io/package/winston.md) ^3.13.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [@abtnode/util](https://npm.io/package/@abtnode/util.md) 1.17.12
- [lodash.isempty](https://npm.io/package/lodash.isempty.md) ^4.4.0
- [@abtnode/constant](https://npm.io/package/@abtnode/constant.md) 1.17.12
- [fast-safe-stringify](https://npm.io/package/fast-safe-stringify.md) ^2.1.1
- [rotating-file-stream](https://npm.io/package/rotating-file-stream.md) ^2.1.6
- [@abtnode/winston-daily-rotate-file](https://npm.io/package/@abtnode/winston-daily-rotate-file.md) ^5.0.1

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

- 1.17.12 (latest) — 2026-04-22
- 1.17.13-beta-20260613-094425-b81920c8 (beta) — 2026-06-13
- 1.16.29-next-680cf137 (next) — 2024-07-19
- 1.2.0-prerelease.1 (prelease) — 2021-02-08
- 1.17.13-beta-20260512-042419-7b556a38 — 2026-05-12
- 1.17.13-beta-20260512-004004-69bacba8 — 2026-05-12
- 1.17.12-beta-20260422-093007-b389a838 — 2026-04-22
- 1.17.12-beta-20260422-090318-b389a838 — 2026-04-22
- 1.17.12-beta-20260422-080315-acb4f448 — 2026-04-22
- 1.17.12-beta-20260422-075550-7bd6bb1a — 2026-04-22
- 1.17.12-beta-20260422-010020-a0ced20c — 2026-04-22
- 1.17.12-beta-20260422-003844-3e4843bf — 2026-04-22
- 1.17.12-beta-20260422-003256-4dcff725 — 2026-04-22
- 1.17.12-beta-20260420-082539-2b9be931 — 2026-04-20
- 1.17.12-beta-20260420-075606-d7d7a9c7 — 2026-04-20
- … 1137 more at https://npm.io/package/@abtnode/logger/versions

## README

# `logger`

This is a log library for ABT Node.

## Enable logging first

Set the environments: `process.env.ABT_NODE_LOG_DIR = {logging directory}`.

## Write to files

Set the environments: `process.env.NODE_ENV = 'production'`.

## Writing to console

`DEBUG=@abtnode/* npm run xxx`.

**Or, the logs will be write to stdout.**

## Rotate log files

Rotate log files every day, log filename formate `{label}-YYYY-MM-DD.log`.

## [!Important] Default retained log files

Because it is for internal use, the default log is kept for **60 days**.

## Usage

```javascript
const logger = require('@abtnode/logger')('@blocklet/cli');

// log info
logger.info('detail blocklet', { did: 'z8iZpWP3gto8RWk9UHfvAaYtqX5wZ3Mz9BrHA' });
// [2020-08-12 17:26:28] [info]  "detail blocklet" {"did":"z8iZpWP3gto8RWk9UHfvAaYtqX5wZ3Mz9BrHA"}

// log error: must pass an object
logger.info('this is an error', { error: new Error('test') });
```

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