Skip to main content
Home

Built and signed on GitHub Actions

Simple log library for containerized applications. Creates JSON and sends it to stdout. If you're looking for full log implementation check other projects. This is meant to be simple and efficient / fast.

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
88%
Published
a week ago (0.3.1)

Introduction

This is a simple log library. It is meant to be used on projects with Docker / containerized applications with Deno or Node.

Nothing special really just a simple log...

So why create another log library? Well I don't need more than what is included... more information just wastes more CPU cycles ... If you need more... use another library.

Usage

This is an example of usage

import { JsonLog } from "@danielfroz/slog";

const log = new JsonLog();
log.info({ msg: `this is a valid log line` });

You may want to add prefix on all log lines from a component... As such use the following

const id = crypto.randomUUID();
const log = new JsonLog({
  level: "INFO",
  init: { handler: "component", id },
});
log.info({ msg: `this is another line` });

Output produced shall include the information passed.

{
  "ts": 1764450995937,
  "level": "INFO",
  "handler": "component",
  "id": "4f8deede-cf40-455a-850e-1807f7410486",
  "msg": "this is another line"
}
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@danielfroz/slog

Import symbol

import * as slog from "@danielfroz/slog";
or

Import directly with a jsr specifier

import * as slog from "jsr:@danielfroz/slog";

Add Package

pnpm i jsr:@danielfroz/slog
or (using pnpm 10.8 or older)
pnpm dlx jsr add @danielfroz/slog

Import symbol

import * as slog from "@danielfroz/slog";

Add Package

yarn add jsr:@danielfroz/slog
or (using Yarn 4.8 or older)
yarn dlx jsr add @danielfroz/slog

Import symbol

import * as slog from "@danielfroz/slog";

Add Package

vlt install jsr:@danielfroz/slog

Import symbol

import * as slog from "@danielfroz/slog";

Add Package

npx jsr add @danielfroz/slog

Import symbol

import * as slog from "@danielfroz/slog";

Add Package

bunx jsr add @danielfroz/slog

Import symbol

import * as slog from "@danielfroz/slog";