Follow leg-format log files and spit out data
The tremor package is a specialized log file parser and follower designed to handle leg-format log files. It monitors log files in real-time, similar to the Unix tail -f command, and converts log entries into structured data streams. With only 259 weekly downloads and a 0.0.1 version number, this is a niche utility package targeting developers who need to process leg-format logs programmatically.
Leg-format appears to be a structured logging format that tremor can parse and emit as JavaScript objects or JSON. The package acts as a bridge between file-based logging systems and Node.js stream consumers, enabling real-time log processing, monitoring, and analysis workflows. It's particularly useful for applications that need to react to log events as they occur rather than batch-processing log files after the fact.
The package is designed for server-side Node.js environments where log file monitoring is required. Given its early version number and modest download count, this appears to be either a specialized tool for a specific logging ecosystem or an early-stage package that hasn't gained wide adoption. The BSD license makes it permissive for both open-source and commercial use.
const Tremor = require('tremor');
const fs = require('fs');
const logFilePath = '/var/log/application.leg';
const tremor = new Tremor(logFilePath);
tremor.on('data', (logEntry) => {
console.log('Parsed log entry:', logEntry);
if (logEntry.level === 'error') {
console.error('ERROR DETECTED:', logEntry.message);
}
});
tremor.on('error', (err) => {
console.error('Tremor error:', err);
});
tremor.follow();
process.on('SIGINT', () => {
tremor.unfollow();
process.exit(0);
});Real-time log monitoring dashboards: Stream log data from application servers into a monitoring dashboard that displays errors, warnings, and system events as they occur, without polling or reloading files repeatedly.
Log aggregation pipelines: Build ETL pipelines that consume logs from multiple sources in leg-format, transform them into a unified schema, and forward them to centralized logging systems like Elasticsearch or Splunk.
Alerting and notification systems: Monitor critical application logs in real-time and trigger alerts or notifications when specific patterns or error conditions appear in the log stream.
Development and debugging tools: Create developer tools that tail application logs during local development, parsing and presenting log data in a more readable format than raw text files.
Log-based metrics extraction: Extract performance metrics, request counts, or business KPIs from structured logs in real-time, feeding them into metrics aggregation systems without waiting for batch processing jobs.
npm install tremorpnpm add tremorbun add tremor