
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
loggerverse
Advanced tools
Enterprise-grade logging library with beautiful console output, file rotation, email alerts, and secure web dashboard
loggerverse - A powerful, enterprise-grade Node.js logging library with beautiful earth-tone dashboard, file log management, email alerts, and real-time monitoring. The complete logging solution for modern applications.
📦 NPM Package | 📚 Documentation | 🐛 Report Issues
Loggerverse stands out from other logging libraries with its comprehensive feature set and beautiful user experience:
Join thousands of developers using loggerverse for better logging! 🚀
npm install loggerverse
# or
yarn add loggerverse
# or
pnpm add loggerverse
import { createLogger, LogLevel } from 'loggerverse';
// Create a simple logger
const logger = createLogger({
level: LogLevel.DEBUG
});
// Log at different levels
logger.debug('Debug information');
logger.info('Application started');
logger.warn('Warning message');
logger.error('Error occurred');
logger.fatal('Critical failure');
// Log with metadata
logger.info('User logged in', {
userId: 123,
username: 'john.doe',
ip: '192.168.1.1'
});
import { createLogger, FileTransport, EmailTransport, LogLevel } from 'loggerverse';
import express from 'express';
const app = express();
// Create a fully configured logger
const logger = createLogger({
level: LogLevel.INFO,
// Global context for all logs
context: {
service: 'api-server',
version: '1.0.0',
environment: process.env.NODE_ENV || 'development'
},
// Data sanitization
sanitization: {
redactKeys: ['password', 'token', 'apiKey', 'secret', 'creditCard'],
maskCharacter: '*'
},
// Enable web dashboard
dashboard: {
enabled: true,
path: '/logs',
users: [
{ username: 'admin', password: 'secure123', role: 'admin' },
{ username: 'viewer', password: 'viewer123', role: 'viewer' }
],
sessionTimeout: 30,
showMetrics: true,
maxLogs: 1000
},
// Multiple transports
transports: [
// File transport with rotation
new FileTransport({
logFolder: './logs',
filename: 'app',
datePattern: 'YYYY-MM-DD',
maxFileSize: 10 * 1024 * 1024, // 10MB
maxFiles: 30,
compressAfterDays: 7
}),
// Email transport for critical errors
new EmailTransport({
provider: 'smtp',
from: 'alerts@yourapp.com',
to: ['admin@yourcompany.com'],
levels: [LogLevel.ERROR, LogLevel.FATAL],
smtp: {
host: 'smtp.gmail.com',
port: 587,
auth: {
user: process.env.SMTP_USER!,
pass: process.env.SMTP_PASS!
}
}
})
]
});
// IMPORTANT: Add dashboard middleware to your Express app
app.use(logger.dashboard.middleware());
// Your application routes
app.get('/', (req, res) => {
logger.info('Home page accessed', { ip: req.ip });
res.send('Hello World!');
});
app.listen(3000, () => {
logger.info('Server started on port 3000');
console.log('Dashboard available at: http://localhost:3000/logs');
});
Loggerverse supports five log levels, each with specific use cases:
import { LogLevel } from 'loggerverse';
// Available levels (in order of severity)
LogLevel.DEBUG // Detailed debug information
LogLevel.INFO // General information
LogLevel.WARN // Warning messages
LogLevel.ERROR // Error messages
LogLevel.FATAL // Critical failures
const logger = createLogger({
// Minimum log level to output
level: LogLevel.INFO,
// Global context added to all logs
context: {
service: 'my-service',
version: '1.0.0'
},
// Sensitive data redaction
sanitization: {
redactKeys: ['password', 'token', 'secret'],
maskCharacter: '*'
},
// Override console methods
overrideConsole: {
preserveOriginal: false,
methods: ['log', 'info', 'warn', 'error', 'debug']
},
// Dashboard configuration
dashboard: {
enabled: true,
path: '/logs',
users: [], // No users = no authentication required
maxLogs: 1000,
title: 'My App Logs'
},
// Array of transport instances
transports: []
});
Automatically included, provides beautiful colored output:
const logger = createLogger({
level: LogLevel.DEBUG
});
// Console output is automatically formatted with:
// - Timestamps
// - Colored log levels
// - Structured metadata
// - Context information
Write logs to files with automatic rotation:
import { FileTransport } from 'loggerverse';
new FileTransport({
// Directory for log files
logFolder: './logs',
// Base filename
filename: 'app',
// Date pattern for rotation (uses moment.js format)
datePattern: 'YYYY-MM-DD',
// Maximum size before rotation (bytes)
maxFileSize: 10 * 1024 * 1024, // 10MB
// Maximum number of log files to keep
maxFiles: 30,
// Compress logs older than X days
compressAfterDays: 7,
// Separate files by log level
separateByLevel: false,
// Include timestamp in filename
includeTimestamp: true,
// Custom filename format function
getFilename: (date: string, level?: string) => `app-${date}-${level}.log`
});
Send email alerts for critical errors:
import { EmailTransport, LogLevel, LogEntry } from 'loggerverse';
// SMTP Configuration
new EmailTransport({
provider: 'smtp',
from: 'alerts@yourapp.com',
to: ['admin@company.com', 'dev@company.com'],
levels: [LogLevel.ERROR, LogLevel.FATAL],
// Batch settings
batch: {
enabled: true,
maxBatchSize: 10,
flushInterval: 5 * 60 * 1000 // 5 minutes
},
// SMTP settings
smtp: {
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: process.env.SMTP_USER!,
pass: process.env.SMTP_PASS!
}
},
// Custom email template
templates: {
subject: (entry: LogEntry) => `Application Error - ${entry.level}`,
html: (logs: LogEntry[]) => `
<h2>Error Report</h2>
<p>The following errors occurred:</p>
<ul>
${logs.map(log => `<li>${log.timestamp} - ${log.message}</li>`).join('')}
</ul>
`
}
});
// AWS SES Configuration
new EmailTransport({
provider: 'ses',
from: 'alerts@yourapp.com',
to: ['admin@company.com'],
levels: [LogLevel.ERROR, LogLevel.FATAL],
ses: {
region: 'us-east-1',
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
}
});
The loggerverse dashboard provides a beautiful, modern interface with:
// Enhanced loggerverse dashboard configuration
dashboard: {
// Enable/disable dashboard
enabled: true,
// URL path for dashboard
path: '/logs',
// Log folder for historical file logs (NEW!)
logFolder: './logs',
// Authentication (empty array = no auth)
users: [
{
username: 'admin',
password: 'secure123',
role: 'admin' // or 'viewer'
}
],
// Session timeout in minutes
sessionTimeout: 30,
// Maximum logs to keep in memory for real-time viewing
maxLogs: 1000,
// Dashboard title (appears in header)
title: 'Loggerverse Dashboard',
// Show system metrics (CPU, Memory, Disk)
showMetrics: true,
// Enable real-time log streaming
realtime: true
}
The dashboard now automatically reads log files from your configured logFolder:
const logger = createLogger({
// File transport saves logs
transports: [
new FileTransport({
logFolder: './logs',
filename: 'app',
format: 'json' // Recommended for dashboard reading
})
],
// Dashboard reads from the same folder
dashboard: {
enabled: true,
logFolder: './logs' // Same folder as file transport
}
});
#ccd5ae) - Primary accent and buttons#e9edc9) - Hover states and borders#fefae0) - Main background#faedcd) - Cards and form backgroundsimport express from 'express';
const app = express();
const logger = createLogger({
dashboard: { enabled: true }
});
// IMPORTANT: Add this middleware
app.use(logger.dashboard!.middleware());
app.listen(3000);
// Dashboard available at http://localhost:3000/logs
loggerverse now automatically reads and displays logs from your file transport:
import { createLogger, FileTransport } from 'loggerverse';
const logger = createLogger({
transports: [
// Save logs to files
new FileTransport({
logFolder: './logs',
filename: 'app',
format: 'json', // JSON format is optimal for dashboard
datePattern: 'YYYY-MM-DD'
})
],
dashboard: {
enabled: true,
logFolder: './logs', // Dashboard reads from same folder
path: '/dashboard'
}
});
{"level":"info","message":"User login","meta":{"userId":123},"timestamp":"2024-01-01T10:00:00.000Z"}
{"level":"error","message":"Database error","meta":{"error":"Connection failed"},"timestamp":"2024-01-01T10:01:00.000Z"}
[Loggerverse] 🟢 01/01/2024 10:00:00 [INFO] [Application] User login
[Loggerverse] 🔴 01/01/2024 10:01:00 [ERROR] [Application] Database error
loggerverse automatically detects log files with date patterns:
app-2024-01-01.json - Date in filenameapp-2024-01-01.log - Text format with dateapplication.log - Uses file modification timeAutomatically redact sensitive information:
const logger = createLogger({
sanitization: {
redactKeys: [
'password',
'token',
'apiKey',
'secret',
'creditCard',
'ssn',
'email',
'phone'
],
maskCharacter: '*'
}
});
// Sensitive data is automatically redacted
logger.info('User login', {
username: 'john',
password: 'secret123', // Will be logged as '***'
apiKey: 'sk_live_abc' // Will be logged as '***'
});
Track request context across your application:
import crypto from 'crypto';
// Middleware for request tracking
app.use((req, res, next) => {
const requestId = crypto.randomBytes(16).toString('hex');
logger.runInContext({
requestId,
method: req.method,
path: req.path,
ip: req.ip
}, () => {
// All logs within this context will include the context data
logger.info('Request started');
next();
});
});
// Logs will include: { requestId, method, path, ip }
Replace native console methods:
const logger = createLogger({
overrideConsole: {
preserveOriginal: false,
methods: ['log', 'info', 'warn', 'error', 'debug']
}
});
// Apply override
logger.overrideConsole();
// Now console methods use Loggerverse
console.log('This goes through Loggerverse');
console.error('This is formatted by Loggerverse');
// Restore original console if needed
logger.restoreConsole();
Creates a new logger instance.
Parameters:
config: LoggerConfig objectReturns: Logger instance
Log debug information
Log general information
Log warning messages
Log error messages
Log critical failures
Run code with additional context
Override native console methods
Restore original console methods
Check if console methods are currently overridden
When dashboard is enabled, additional methods are available:
Returns Express middleware for serving the dashboard
Cleanup dashboard resources and close connections
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm test -- dashboard.test.ts
Loggerverse is written in TypeScript and provides full type definitions:
import { createLogger, LogLevel, Logger, LogEntry } from 'loggerverse';
const logger: Logger = createLogger({
level: LogLevel.INFO
});
logger.info('TypeScript support included');
# Email configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
# AWS SES (if using)
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_REGION=us-east-1
# Dashboard
DASHBOARD_USERS=[{"username":"admin","password":"secure123"}]
SESSION_TIMEOUT=30
# General
NODE_ENV=production
LOG_LEVEL=info
Use Appropriate Log Levels
Secure Your Dashboard
Optimize File Log Management
Dashboard Performance
maxLogs limits for memory usagelogFolder pathsEmail Alerts
Earth-Tone Dashboard Usage
Contributions are welcome! Please feel free to submit a Pull Request to our GitHub repository.
MIT © Jatin
Made with ❤️ by Jatin and the Loggerverse community
FAQs
Enterprise-grade logging library with beautiful console output, file rotation, email alerts, and secure web dashboard
The npm package loggerverse receives a total of 31 weekly downloads. As such, loggerverse popularity was classified as not popular.
We found that loggerverse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.