Skip to content

LuccaZVPS/Logify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node-Logify

Node-Logify is a lightweight Node.js library with Express and Pino support, designed for simple system monitoring with minimal infrastructure configuration and low resource consumption.

Installation

npm install node-logify

Login Screen

Logs Page

Requests Page

Basic Usage

const express = require("express");
const pino = require("pino");
const { logify } = require("node-logify");

const app = express();

// Configure Logify
const { pinoStream, expressObserver, database } = logify(app, {
  users: [
    {
      name: "Admin User",
      email: "admin@example.com",
      password: "admin123",
    },
  ],
  databasePath: "app-logs.db",
  prefix: "/logify",
  host: "localhost:3000",
});

// Use the express observer middleware
app.use(expressObserver);

// Create your logger
const logger = pino(
  { level: "info" },
  pino.multistream([{ stream: process.stdout }, { stream: pinoStream }])
);

// Your application routes
app.get("/", (req, res) => {
  logger.info({ userId: "123", action: "homepage_visit" });
  res.json({ message: "Hello World!" });
});

app.listen(3000, () => {
  console.log("Server running on http://localhost:3000");
  console.log("Logify dashboard: http://localhost:3000/logify");
});

Configuration

LogifyConfig Interface

interface LogifyConfig {
  users: User[]; // Array of users for authentication
  databasePath?: string; // SQLite database file path (default: "logify.db")
  prefix?: string; // URL prefix for Logify routes (default: "/logify")
  host?: string; // Host for API configuration (default: "localhost:3000")
}

interface User {
  name: string; // User display name
  email: string; // User email (used for login)
  password: string; // User password (will be hashed)
}

Configuration Options

Option Type Default Description
users User[] Required Array of users for dashboard authentication
databasePath string "logify.db" Path to SQLite database file
prefix string "/logify" URL prefix for all Logify routes
host string "localhost:3000" Host used in API configuration

Dashboard Features

Logs View

  • Real-time log streaming
  • Log details with full context

HTTP Requests

  • Request/response monitoring

System Monitoring

  • CPU usage and information
  • Memory consumption
  • Disk space monitoring
  • Load average tracking
  • Real-time updates

About

A lightweight Node.js monitoring library with Express integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors