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

@arikajs/logging

v0.10.7

Published

Flexible, channel-based logging system for the ArikaJS framework.

Readme

Arika Logging

@arikajs/logging provides a flexible, channel-based logging system for the ArikaJS framework.

It allows applications to write logs to multiple destinations (console, files, external services) using a unified API.


✨ Features

  • Multiple log channels: Separate outputs for different needs
  • Driver-based architecture: Pluggable backends (console, file, slack, etc.)
  • Log levels: RFC 5424 compliant (emergency, alert, critical, error, warning, notice, info, debug)
  • Shared Context: Set global metadata across all log entries
  • JSON Formatting: Native support for structured logs
  • Stackable channels: Combine multiple channels
  • File & console drivers: Essential logging outputs
  • Slack integration: Native webhook support for critical alerts
  • TypeScript-first: Strongly typed interface

📦 Installation

npm install @arikajs/logging
# or
yarn add @arikajs/logging
# or
pnpm add @arikajs/logging

🚀 Basic Usage

import { Log } from '@arikajs/logging';

Log.info('Application started');
Log.error('Something went wrong', { userId: 1 });

Log.channel('daily').warning('Low disk space');


### 🎨 Formatting System

Arika Logging supports a pluggable formatting system. You can choose from built-in formatters or create your own.

**Available Formatters:**
- `json`: Structured JSON output (merges context into root)
- `pretty`: Colored text output for development
- `line` (or `text`): Standard plain text output

```ts
export default {
  channels: {
    // Production: Structured JSON for ELK/Datadog
    app: {
      driver: 'file',
      path: './logs/app.json',
      formatter: 'json',
    },

    // Development: Colored console output
    console: {
      driver: 'console',
      formatter: 'pretty',
    }
  }
}

JSON Output Example:

{
  "timestamp": "2026-02-21T10:30:00Z",
  "level": "info",
  "message": "User logged in",
  "userId": 1,
  "ip": "127.0.0.1"
}

🧠 Shared Context

You can append context that will be included in every subsequent log entry for that logger.

Log.withContext({ traceId: 'req_123' });

Log.info('Processing order'); // Included traceId: req_123
Log.error('Order failed');    // Included traceId: req_123

⚙️ Configuration

export default {
  default: process.env.LOG_CHANNEL || 'stack',

  channels: {
    stack: {
      driver: 'stack',
      channels: ['single'],
    },

    single: {
      driver: 'file',
      path: './storage/logs/arika.log',
      level: process.env.LOG_LEVEL || 'debug',
    },

    daily: {
      driver: 'daily',
      path: './storage/logs/arika.log',
      level: process.env.LOG_LEVEL || 'debug',
      days: 14,
    },

    console: {
      driver: 'console',
      level: process.env.LOG_LEVEL || 'debug',
      formatter: 'json', // Use 'json' for structured logs
    },

    slack: {
      driver: 'slack',
      url: process.env.LOG_SLACK_WEBHOOK_URL,
      level: 'critical',
    },
  },
};

🔌 Supported Drivers (v1)

| Driver | Status | Description | | :--- | :--- | :--- | | Console | ✅ Supported | Standard output logging (Supports JSON) | | File | ✅ Supported | Single file logging (Supports JSON) | | Daily | ✅ Supported | Date-based rotating log files | | Stack | ✅ Supported | Multi-channel composite logging | | Slack | ✅ Supported | Critical alerts via Webhooks | | Papertrail | ⏳ Planned | External service driver |


🔗 Integration

  • @arikajs/http → request logs
  • @arikajs/queue → job logs
  • @arikajs/events → event logs
  • @arikajs/auth → security logs

🏗 Architecture

logging/
├── src/
│   ├── Contracts
│   │   ├── Formatter.ts
│   │   └── Logger.ts
│   ├── Drivers
│   │   ├── ConsoleDriver.ts
│   │   ├── DailyDriver.ts
│   │   ├── FileDriver.ts
│   │   └── SlackDriver.ts
│   ├── Formatters
│   │   ├── JsonFormatter.ts
│   │   └── LineFormatter.ts
│   ├── index.ts
│   ├── Logger.ts
│   └── LogManager.ts
├── tests/
├── package.json
├── tsconfig.json
└── README.md

📄 License

@arikajs/logging is open-source software licensed under the MIT License.


🧭 Philosophy

"Logs tell the story your app can’t."