New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@rotorsoft/act-pino

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rotorsoft/act-pino

Pino logger adapter for @rotorsoft/act

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

@rotorsoft/act-pino

Pino logger adapter for the @rotorsoft/act event sourcing framework.

Replaces Act's built-in ConsoleLogger with pino — structured JSON logging, log levels, transports, redaction, and pretty-printing in development.

Install

pnpm add @rotorsoft/act-pino

Quick Start

import { log } from "@rotorsoft/act";
import { PinoLogger } from "@rotorsoft/act-pino";

// Replace the default logger — all framework logging now goes through pino
log(new PinoLogger());

Configuration

PinoLogger accepts an options object:

OptionTypeDefaultDescription
levelstringconfig().logLevelLog level (trace, debug, info, warn, error, fatal)
prettybooleantrue in non-productionEnable pino-pretty for human-readable output
optionspino.LoggerOptions{}Pass-through to pino (transports, serializers, redaction, etc.)

Examples

// Custom log level
log(new PinoLogger({ level: "debug" }));

// Disable pretty-printing (structured JSON only)
log(new PinoLogger({ pretty: false }));

// Pino-native options (redaction, serializers, etc.)
log(new PinoLogger({
  options: {
    redact: ["password", "secret", "token"],
    serializers: {
      req: (req) => ({ method: req.method, url: req.url }),
    },
  },
}));

Logger Interface

PinoLogger implements the Act framework's Logger interface:

interface Logger {
  level: string;
  trace(obj: unknown, msg?: string): void;
  debug(obj: unknown, msg?: string): void;
  info(obj: unknown, msg?: string): void;
  warn(obj: unknown, msg?: string): void;
  error(obj: unknown, msg?: string): void;
  fatal(obj: unknown, msg?: string): void;
  child(bindings: Record<string, unknown>): Logger;
  dispose(): Promise<void>;
}

String and object messages

const logger = new PinoLogger();

// String message
logger.info("Server started");

// Object with message
logger.info({ port: 4000 }, "Server started");

// Object only (no message)
logger.info({ event: "startup", port: 4000 });

Child loggers

Create scoped loggers with inherited bindings:

const parent = new PinoLogger();
const child = parent.child({ module: "payments" });

child.info("Processing payment"); // includes { module: "payments" }

Cleanup

await logger.dispose(); // flushes buffered logs

Environment Integration

PinoLogger reads defaults from Act's config():

  • logLevel — controlled by LOG_LEVEL env var (default: "info")
  • logSingleLine — controlled by LOG_SINGLE_LINE env var (affects pino-pretty formatting)
  • env — when "production", pretty-printing is disabled by default (structured JSON output)

License

MIT

FAQs

Package last updated on 25 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts