# zerilog

Latest version **2.1.1** (published 2026-02-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install zerilog
pnpm add zerilog
yarn add zerilog
bun add zerilog
```

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2026-02-05 |
| First published | 2022-05-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | sh4dow.dev <sh4dowpp@gmail.com> |
| Maintainers | sh4dow8080 |
| Keywords | zerilog, logger, logging |

## Links

- npm: https://www.npmjs.com/package/zerilog
- Repository: https://github.com/Sh4dow8080/zerilog
- npm.io page: https://npm.io/package/zerilog

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

- 2.1.1 (latest) — 2026-02-05
- 2.1.0 — 2024-07-08
- 2.0.5 — 2024-07-03
- 2.0.4 — 2024-07-03
- 2.0.3 — 2024-07-03
- 2.0.2 — 2024-07-02
- 2.0.1 — 2024-06-28
- 2.0.0 — 2024-06-28
- 1.2.2 — 2022-09-17
- 1.2.1 — 2022-08-03
- 1.2.0 — 2022-07-08
- 1.1.3 — 2022-07-06
- 1.1.2 — 2022-07-06
- 1.1.1 — 2022-07-05
- 1.1.0 — 2022-05-27
- … 2 more at https://npm.io/package/zerilog/versions

## README

# 🚀Zerilog

Zerilog is a TypeScript logging framework inspired by Serilog, designed to provide a flexible and structured logging solution for TypeScript applications. It simplifies the process of logging, offering rich features and customization options to suit various logging needs.

## Features

-   🏗️ **Structured Logging**: Log messages with structured data to easily filter and search logs.
-   🚰 **Multiple "Zinks"**: Output logs to different destinations (console, file, HTTP, etc.).
-   ⚙️ **Configurable Enrichers**: Enrich log events with additional contextual information.
-   📊 **Support for Logging Levels**: Control the verbosity of logs with different logging levels (e.g., debug, info, warn, error).
-   📝 **Template-Based Messages**: Use template-based messages for consistent and readable logs.
-   🔄 **Asynchronous Logging**: Efficiently handle logging in asynchronous environments.

## Getting Started

To get started with Zerilog, install the package using npm:

```bash
npm install zerilog
yarn add zerilog
pnpm add zerilog
```

## Usage

Here's a quick example to get you started:

```ts
import { LoggerConfiguration } from "zerilog";

// A simple console zink to log events to the console.
// npm install @zerilog/consolezink
import ConsoleZink from "@zerilog/consolezink";

const logger = new LoggerConfiguration()
	.writeTo.sink(new ConsoleZink())
	.createLogger();

logger.information("Hello World");
logger.information("Support for {Variable} strings!", "Formatted");
```

## Implementing a Custom Zink

Zerilog allows you to define custom "zinks" (destinations for your logs). Here's a simple example of a console zink:

```ts
import { ILogZink, LogEvent } from "zerilog";

class ConsoleZink implements ILogZink {
	log(event: LogEvent): void {
		console.log(event.message.renderedMessage);
	}
}
```

## Contact

-   [Discord](https://discord.com/users/251026389371846656)
-   [Github](https://github.com/sh4dow8080)

## Acknowledgements

-   Heavily inspired by `Serilog`.

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