c019c062c869c6ae467207ac7817371840317867
🚀 Log Tail Monitor
A modern, beautiful real-time log monitoring application with a web interface. Monitor your log files in real-time using Server-Sent Events (SSE) with advanced filtering, highlighting, and export capabilities.
✨ Features
- 🔄 Real-time Monitoring: Uses Server-Sent Events for instant log updates
- 🎨 Modern UI: Beautiful, responsive interface with dark/light mode support
- 🔍 Advanced Filtering: Filter logs by content with real-time search
- ✨ Smart Highlighting: Highlight important text with visual indicators
- 📊 Log Classification: Automatic classification of log levels (success, error, warning, info)
- 💾 Export Functionality: Export filtered logs to text files
- ⏸️ Pause/Resume: Control log streaming as needed
- 📱 Mobile Responsive: Works great on all device sizes
- 🔒 Secure: Path traversal protection and proper error handling
- ⚡ High Performance: Handles thousands of log lines efficiently
🚀 Quick Start
Prerequisites
- Node.js 14.0.0 or higher
- npm (comes with Node.js)
Installation
- Clone or download this repository
- Install dependencies:
npm install
Running the Application
Production Mode
npm start [directory]
Development Mode (default ./logs directory)
npm run dev
Demo Mode (with sample logs)
npm run demo
Example
# Monitor logs in /var/log directory
npm start /var/log
# Monitor logs in current directory's logs folder
npm run dev
# Run demo with sample data
npm run demo
🌐 Usage
-
Access the Web Interface: Open your browser and go to
http://localhost:3000/tail -
Select a File: Choose a log file from the sidebar to start monitoring
-
Filter Logs: Use the filter input to show only logs containing specific text
-
Highlight Text: Use the highlight input to emphasize important content
-
Control Playback:
- Toggle auto-scroll on/off
- Pause/resume log streaming
- Clear current logs
- Export filtered results
-
Interact with Logs: Click on any log line to expand it for better readability
🔧 API Endpoints
REST API
GET /tail/api/health- Health check and statusGET /tail/api/files- List available log filesGET /tail/api/files/:filename- Stream specific file (SSE)
⚙️ Configuration
Command Line Arguments
node index.js [log-directory]
log-directory- Path to directory containing log files (default: ./logs)
🎨 Log Classification
The application automatically classifies log lines:
- 🟢 Success: HTTP 2xx responses, successful operations
- 🔴 Error: HTTP non-2xx responses, errors, failures
- 🟡 Warning: Warning messages
- 🔵 Info: General information, bot traffic
📝 License
MIT License - see LICENSE file for details
Descripción
Languages
JavaScript
57.4%
CSS
34.7%
HTML
7.9%
