Files
plane/packages/logger
sriram veeraghanta b99ddc24e7 [WEB-4810] feat: migrate to tsdown from tsup (#7679)
* feat: migrat to tsdown to tsup

* fix: build scripts

* fix: lock file fixes

* fix: adding build process to i18n and propel packages

* fix: lint warning

* chore: update services module entry points

* fix: lock file

* fix: lock file

* fix: remove tsc from build

* fix: tsdown configs

* fix: remove tsc step from build process

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
Co-authored-by: Aaron Reisman <aaron.reisman@plane.so>
2025-09-03 14:01:57 +05:30
..

Logger Package

This package provides a logger and a request logger utility built using Winston. It offers customizable log levels using env and supports structured logging for general application logs and HTTP requests.

Features.

  • Dynamic log level configuration using env.
  • Pre-configured winston logger for general usage (logger).
  • Request logger middleware that logs incoming request

Usage

Adding as a package

Add this package as a dependency in package.json

dependency: {
    ...
    @plane/logger":"*",
    ...
}

Importing the Logger

import { logger, requestLogger } from "@plane/logger";

Usage

logger: General Logger

Use this for general application logs.

logger.info("This is an info log");
logger.warn("This is a warning");
logger.error("This is an error");

requestLogger: Request Logger Middleware

Use this as a middleware for incoming requests

const app = express();
app.use(requestLogger);

Available Log Levels

  • error
  • warn
  • info (default)
  • http
  • verbose
  • debug
  • silly

Log file

  • Log files are stored in logs folder of current working directory. Error logs are stored in files with format error-%DATE%.log and combined logs are stored with format combined-%DATE%.log.
  • Log files have a 7 day rotation period defined.

Configuration

  • By default, the log level is set to info.
  • You can specify a log level by adding a LOG_LEVEL in .env.