npm package: @logtape/logtape
Description: Unobtrusive logging library with zero dependencies—library-first design for Deno/Node.js/Bun/browsers/edge
Author: Hong Minhee
Latest version: 2.0.5

<!-- deno-fmt-ignore-file -->

LogTape
=======

[![JSR][JSR badge]][JSR]
[![npm][npm badge]][npm]
[![Bundlephobia][Bundlephobia badge]][Bundlephobia]
[![GitHub Actions][GitHub Actions badge]][GitHub Actions]
[![Codecov][Codecov badge]][Codecov]

LogTape is a logging library for JavaScript and TypeScript designed with
a library-first philosophy.  Unlike traditional loggers, LogTape is
unobtrusive—libraries can safely log without any configuration, while
applications retain full control.  With zero dependencies and universal runtime
support, it works seamlessly across Deno, Node.js, Bun, browsers, and edge
functions.

The highlights of LogTape are:

 -  *Zero dependencies*: LogTape has zero dependencies.  You can use LogTape
    without worrying about the dependencies of LogTape.

 -  *[Library support]*: LogTape is designed to be used in libraries as well
    as applications.  You can use LogTape in libraries to provide logging
    capabilities to users of the libraries.

 -  *[Runtime diversity]*: LogTape supports Deno, Node.js, Bun, edge functions,
    and browsers.  You can use LogTape in various environments without
    changing the code.

 -  *[Structured logging]*: You can log messages with structured data.

 -  *[Hierarchical categories]*: LogTape uses a hierarchical category system
    to manage loggers.  You can control the verbosity of log messages by
    setting the log level of loggers at different levels of the category
    hierarchy.

 -  *[Template literals]*: LogTape supports template literals for log messages.
    You can use template literals to log messages with placeholders and
    values.

 -  *[Built-in data redaction]*: LogTape provides robust capabilities to redact
    sensitive information from logs using pattern-based or field-based
    approaches.

 -  *[Dead simple sinks]*: You can easily add your own sinks to LogTape.

 -  *[Framework integrations]*: First-class support for popular frameworks
    like [Express], [Fastify], [Hono], [Koa], and [Drizzle ORM] with automatic
    HTTP request logging and database query logging.

![LogTape web console output](https://raw.githubusercontent.com/dahlia/logtape/refs/heads/main/screenshots/web-console.png)
![LogTape terminal output](https://raw.githubusercontent.com/dahlia/logtape/refs/heads/main/screenshots/terminal.png)

[JSR badge]: https://jsr.io/badges/@logtape/logtape
[JSR]: https://jsr.io/@logtape/logtape
[npm badge]: https://img.shields.io/npm/v/@logtape/logtape?logo=npm
[npm]: https://www.npmjs.com/package/@logtape/logtape
[Bundlephobia badge]: https://badgen.net/bundlephobia/dependency-count/@logtape/logtape
[Bundlephobia]: https://bundlephobia.com/package/@logtape/logtape
[GitHub Actions badge]: https://github.com/dahlia/logtape/actions/workflows/main.yaml/badge.svg
[GitHub Actions]: https://github.com/dahlia/logtape/actions/workflows/main.yaml
[Codecov badge]: https://codecov.io/gh/dahlia/logtape/graph/badge.svg?token=yOejfcuX7r
[Codecov]: https://codecov.io/gh/dahlia/logtape
[Library support]: https://logtape.org/manual/library
[Runtime diversity]: https://logtape.org/manual/install
[Structured logging]: https://logtape.org/manual/struct
[Hierarchical categories]: https://logtape.org/manual/categories
[Template literals]: https://logtape.org/manual/start#how-to-log
[Built-in data redaction]: https://logtape.org/manual/redaction
[Dead simple sinks]: https://logtape.org/manual/sinks
[Framework integrations]: https://logtape.org/manual/integrations
[Express]: https://expressjs.com/
[Fastify]: https://fastify.dev/
[Hono]: https://hono.dev/
[Koa]: https://koajs.com/
[Drizzle ORM]: https://orm.drizzle.team/


Installation
------------

LogTape is available on [JSR] and [npm].  You can install LogTape for various
JavaScript runtimes and package managers:

~~~~ sh
deno add jsr:@logtape/logtape  # for Deno
npm  add     @logtape/logtape  # for npm
pnpm add     @logtape/logtape  # for pnpm
yarn add     @logtape/logtape  # for Yarn
bun  add     @logtape/logtape  # for Bun
~~~~

See also the [installation manual][Runtime diversity] for more details.


Packages
--------

LogTape is a monorepo that contains several packages.  The main package is
*@logtape/logtape*, which provides the core logging functionality.  Other
packages provide additional features and integrations.  The following is a
list of the packages in the LogTape monorepo:

| Package                                                    | JSR                                  | npm                                  | Description                |
| ---------------------------------------------------------- | ------------------------------------ | ------------------------------------ | -------------------------- |
| [*@logtape/logtape*](/packages/logtape/)                   | [JSR][jsr:@logtape/logtape]          | [npm][npm:@logtape/logtape]          | Core logging functionality |
| [*@logtape/adaptor-log4js*](/packages/adaptor-log4js/)     | [JSR][jsr:@logtape/adaptor-log4js]   | [npm][npm:@logtape/adaptor-log4js]   | [log4js] adapter           |
| [*@logtape/adaptor-pino*](/packages/adaptor-pino/)         | [JSR][jsr:@logtape/adaptor-pino]     | [npm][npm:@logtape/adaptor-pino]     | [Pino] adapter             |
| [*@logtape/adaptor-winston*](/packages/adaptor-winston/)   | [JSR][jsr:@logtape/adaptor-winston]  | [npm][npm:@logtape/adaptor-winston]  | [winston] adapter          |
| [*@logtape/cloudwatch-logs*](/packages/cloudwatch-logs/)   | [JSR][jsr:@logtape/cloudwatch-logs]  | [npm][npm:@logtape/cloudwatch-logs]  | [AWS CloudWatch Logs] sink |
| [*@logtape/config*](/packages/config/)                     | [JSR][jsr:@logtape/config]           | [npm][npm:@logtape/config]           | Object-based configuration |
| [*@logtape/drizzle-orm*](/packages/drizzle-orm/)           | [JSR][jsr:@logtape/drizzle-orm]      | [npm][npm:@logtape/drizzle-orm]      | [Drizzle ORM] integration  |
| [*@logtape/elysia*](/packages/elysia/)                     | [JSR][jsr:@logtape/elysia]           | [npm][npm:@logtape/elysia]           | [Elysia] integration       |
| [*@logtape/express*](/packages/express/)                   | [JSR][jsr:@logtape/express]          | [npm][npm:@logtape/express]          | [Express] integration      |
| [*@logtape/fastify*](/packages/fastify/)                   | [JSR][jsr:@logtape/fastify]          | [npm][npm:@logtape/fastify]          | [Fastify] integration      |
| [*@logtape/hono*](/packages/hono/)                         | [JSR][jsr:@logtape/hono]             | [npm][npm:@logtape/hono]             | [Hono] integration         |
| [*@logtape/koa*](/packages/koa/)                           | [JSR][jsr:@logtape/koa]              | [npm][npm:@logtape/koa]              | [Koa] integration          |
| [*@logtape/file*](/packages/file/)                         | [JSR][jsr:@logtape/file]             | [npm][npm:@logtape/file]             | File sinks                 |
| [*@logtape/otel*](/packages/otel/)                         | [JSR][jsr:@logtape/otel]             | [npm][npm:@logtape/otel]             | [OpenTelemetry] sink       |
| [*@logtape/pretty*](/packages/pretty/)                     | [JSR][jsr:@logtape/pretty]           | [npm][npm:@logtape/pretty]           | Beautiful text formatter   |
| [*@logtape/redaction*](/packages/redaction/)               | [JSR][jsr:@logtape/redaction]        | [npm][npm:@logtape/redaction]        | Data redaction             |
| [*@logtape/sentry*](/packages/sentry/)                     | [JSR][jsr:@logtape/sentry]           | [npm][npm:@logtape/sentry]           | [Sentry] sink              |
| [*@logtape/syslog*](/packages/syslog/)                     | [JSR][jsr:@logtape/syslog]           | [npm][npm:@logtape/syslog]           | Syslog sink                |
| [*@logtape/windows-eventlog*](/packages/windows-eventlog/) | [JSR][jsr:@logtape/windows-eventlog] | [npm][npm:@logtape/windows-eventlog] | Windows Event Log sink     |

[jsr:@logtape/logtape]: https://jsr.io/@logtape/logtape
[npm:@logtape/logtape]: https://www.npmjs.com/package/@logtape/logtape
[jsr:@logtape/adaptor-log4js]: https://jsr.io/@logtape/adaptor-log4js
[npm:@logtape/adaptor-log4js]: https://www.npmjs.com/package/@logtape/adaptor-log4js
[log4js]: https://log4js-node.github.io/log4js-node/
[jsr:@logtape/adaptor-pino]: https://jsr.io/@logtape/adaptor-pino
[npm:@logtape/adaptor-pino]: https://www.npmjs.com/package/@logtape/adaptor-pino
[Pino]: https://github.com/pinojs/pino
[jsr:@logtape/adaptor-winston]: https://jsr.io/@logtape/adaptor-winston
[npm:@logtape/adaptor-winston]: https://www.npmjs.com/package/@logtape/adaptor-winston
[winston]: https://github.com/winstonjs/winston
[jsr:@logtape/cloudwatch-logs]: https://jsr.io/@logtape/cloudwatch-logs
[npm:@logtape/cloudwatch-logs]: https://www.npmjs.com/package/@logtape/cloudwatch-logs
[AWS CloudWatch Logs]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/
[jsr:@logtape/config]: https://jsr.io/@logtape/config
[npm:@logtape/config]: https://www.npmjs.com/package/@logtape/config
[jsr:@logtape/drizzle-orm]: https://jsr.io/@logtape/drizzle-orm
[npm:@logtape/drizzle-orm]: https://www.npmjs.com/package/@logtape/drizzle-orm
[jsr:@logtape/elysia]: https://jsr.io/@logtape/elysia
[npm:@logtape/elysia]: https://www.npmjs.com/package/@logtape/elysia
[Elysia]: https://elysiajs.com/
[jsr:@logtape/express]: https://jsr.io/@logtape/express
[npm:@logtape/express]: https://www.npmjs.com/package/@logtape/express
[jsr:@logtape/fastify]: https://jsr.io/@logtape/fastify
[npm:@logtape/fastify]: https://www.npmjs.com/package/@logtape/fastify
[jsr:@logtape/hono]: https://jsr.io/@logtape/hono
[npm:@logtape/hono]: https://www.npmjs.com/package/@logtape/hono
[jsr:@logtape/koa]: https://jsr.io/@logtape/koa
[npm:@logtape/koa]: https://www.npmjs.com/package/@logtape/koa
[jsr:@logtape/file]: https://jsr.io/@logtape/file
[npm:@logtape/file]: https://www.npmjs.com/package/@logtape/file
[jsr:@logtape/otel]: https://jsr.io/@logtape/otel
[npm:@logtape/otel]: https://www.npmjs.com/package/@logtape/otel
[OpenTelemetry]: https://opentelemetry.io/
[jsr:@logtape/pretty]: https://jsr.io/@logtape/pretty
[npm:@logtape/pretty]: https://www.npmjs.com/package/@logtape/pretty
[jsr:@logtape/redaction]: https://jsr.io/@logtape/redaction
[npm:@logtape/redaction]: https://www.npmjs.com/package/@logtape/redaction
[jsr:@logtape/sentry]: https://jsr.io/@logtape/sentry
[npm:@logtape/sentry]: https://www.npmjs.com/package/@logtape/sentry
[Sentry]: https://sentry.io/
[jsr:@logtape/syslog]: https://jsr.io/@logtape/syslog
[npm:@logtape/syslog]: https://www.npmjs.com/package/@logtape/syslog
[jsr:@logtape/windows-eventlog]: https://jsr.io/@logtape/windows-eventlog
[npm:@logtape/windows-eventlog]: https://www.npmjs.com/package/@logtape/windows-eventlog


Docs
----

The docs of LogTape is available at <https://logtape.org/>.
For the API references, see <https://jsr.io/@logtape/logtape>.