npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@juicyjah/juicy-logs-kit-svelte

v0.3.7

Published

Logging tool for sending app logs and events to Juicy Logs from SvelteKit applications

Readme

juicy-logs-kit-svelte

The official logging tool for sending app logs and events to Juicy Logs from SvelteKit applications.

This package is meant to abstract the boiler plate of sending logs and events to the Juicy Logs servers, as well as subscribing to the event pubsub.

Signup for a free account at https://logs.juicyjah.com/signup and take the first step to a fresh and painless app logging and event pub/sub experience.

How to use

  1. Install the package with npm
npm i juicy-logs-kit-svelte
  1. Add to your SvelteKit app.
// src/hooks.server.js
import { sequence } from '@sveltejs/kit/hooks'
import { Logger } from "juicy-logs-kit-svelte"
...

const { hooks } = new Logger()

export const handle = sequence(hooks.handle, otherHandleFunction)

export const handleError = sequence(hooks.handleError, otherHandleErrorFunction)
  1. In your environment variables, provide the URL and API token needed to access your logs at Juicy Logs.
#.env

...
JUICY_LOGS_URL=https://logs.juicyjah.com
JUICY_LOGS_TOKEN=your-token-here
JUICY_LOGS_SOURCE_NAME=your-app-name-here
  1. Access your logs at https://logs.juicyjah.com

Configure your logs

You can customize the logging behavior by passing a configuration object when initializing the Logger:

const { hooks } = new Logger({
  log_debug: true,      // Enable/disable debug logs
  log_info: true,       // Enable/disable info logs
  log_error: true,      // Enable/disable error logs
  log_warn: true,       // Enable/disable warning logs
  log_http_methods: ['GET', 'POST', 'PUT', 'DELETE'],  // HTTP methods to log
  exclude_http_methods: [],  // HTTP methods to exclude from logging
  log_http_status_codes: [200, 201, 400, 401, 403, 404, 500], // Status codes to log
  exclude_http_status_codes: [], // Status codes to exclude from logging
  exclude_routes: ['/health-check'], // Routes to exclude from logging
  console: false        // Enable console logging in addition to sending to Juicy Logs
})

All configuration options are optional and will use sensible defaults if not specified.

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | log_debug | boolean | true | Controls whether debug-level logs are processed and sent to Juicy Logs | | log_info | boolean | true | Controls whether info-level logs are processed and sent to Juicy Logs | | log_error | boolean | true | Controls whether error-level logs are processed and sent to Juicy Logs | | log_warn | boolean | true | Controls whether warning-level logs are processed and sent to Juicy Logs | | log_http_methods | string[] | ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'] | List of HTTP methods that should be logged | | exclude_http_methods | string[] | [] | List of HTTP methods that should be excluded from logging. Takes precedence over log_http_methods | | log_http_status_codes | number[] | [100-511] | List of HTTP status codes that should be logged. Defaults to all standard HTTP status codes | | exclude_http_status_codes | number[] | [] | List of HTTP status codes that should be excluded from logging. Takes precedence over log_http_status_codes | | exclude_routes | string[] | [] | List of route patterns that should be excluded from logging (e.g. ['/health-check', '/api/metrics']) | | console | boolean | false | When true, logs will also be output to the console in addition to being sent to Juicy Logs |

Using Events

Juicy Logs supports event pushing for tracking important application events. To use events:

import { EventPusher } from "juicy-logs-kit-svelte"

// Create an event pusher instance
const eventPusher = new EventPusher()

// Push a simple event with just a message
await eventPusher.push("User logged in")

// Push a detailed event
await eventPusher.push({
  type: "user_action",        // Event type for categorization
  type_id: "login",          // Specific event identifier
  action: "login_successful", // The action that occurred
  message: "User successfully logged in",  // Human-readable message
  data: {                    // Additional event data
    userId: "123",
    timestamp: new Date(),
    browser: "Chrome"
  }
})

// You can also use the static method
await EventPusher.push({
  type: "system_event",
  message: "Application started"
})

Events require either a type or type_id field to be specified when sending detailed events. The message field is optional but recommended for better readability in your event logs.

Event Fields

| Field | Type | Required | Description | |-------|------|----------|-------------| | type | string | Yes* | Category or classification of the event (e.g., 'user_action', 'system_event') | | type_id | string | Yes* | Category or classification ID of the event (e.g., 'asflsdfuilur-134cadsrfq34-asfae23') | | message | string | No | Human-readable description of the event | | data | object | No | Additional structured data related to the event | | source | string | No | Source of the event (defaults to JUICY_LOGS_SOURCE_NAME from env) |

* Either type or type_id must be specified for detailed events

You can view your events in the Events section of your Juicy Logs dashboard at https://logs.juicyjah.com.

TODO

  • Add events pubsub subscription functionality
  • Add more request metadata logging (headers, user agent, etc.)
  • Add support for custom log formatters
  • Add batch event processing