UNPKG

log-vista

Version:

LogVista Agent - Lightweight system monitoring and log collection for any project/language

205 lines (159 loc) 4.12 kB
# LogVista Agent Universal monitoring agent for any programming language or framework. Monitor logs, metrics, and system performance with ease. ## Quick Start ### Global Installation ```bash npm install -g @logvista/agent ``` ### Initialize in Your Project Navigate to any project directory and run: ```bash logvista init ``` This works with projects in any language: - **Node.js** (Express, Fastify, NestJS, etc.) - **PHP** (Laravel, Symfony, CodeIgniter, etc.) - **Python** (Django, Flask, FastAPI, etc.) - **.NET** (Core, Framework, ASP.NET, etc.) - **Go** (Gin, Echo, Fiber, etc.) - **Java** (Spring Boot, etc.) - **Ruby** (Rails, Sinatra, etc.) - **Any application that writes log files** ### Start Monitoring ```bash logvista start ``` ### Check Status ```bash logvista status ``` ## Commands | Command | Description | |---------|-------------| | `logvista init` | Initialize monitoring in current directory | | `logvista start` | Start monitoring | | `logvista stop` | Stop monitoring | | `logvista status` | Check monitoring status | | `logvista config --show` | Show current configuration | | `logvista install` | Install globally (admin required) | ## Automatic Log Detection The agent automatically detects log files based on common patterns for different languages: ### PHP Projects - `storage/logs/*.log` (Laravel) - `var/log/*.log` (Symfony) - `logs/*.log` ### .NET Projects - `Logs/*.log` - `bin/Debug/netcoreapp*/*.log` - `bin/Release/netcoreapp*/*.log` ### Python Projects - `logs/*.log` - `log/*.log` - `*.log` (root level) ### Node.js Projects - `logs/*.log` - `log/*.log` - `*.log` (root level) ### Go Projects - `*.log` (root level) - `logs/*.log` ### Java Projects - `logs/*.log` - `log/*.log` ### Ruby/Rails Projects - `log/*.log` - `tmp/*.log` ## Configuration After running `logvista init`, edit `.logvista/config.json`: ```json { "central_system": { "url": "http://localhost:3001", "token": "your-agent-token-here" }, "collection": { "interval": 30, "batch_size": 100, "retry_attempts": 3, "retry_delay": 5000 }, "projects": [ { "project_name": "my-app", "pwd_path": "/path/to/project", "custom_log_paths": [ "/path/to/project/logs/*.log" ], "enabled": true } ] } ``` ## Features -**Universal**: Works with any language/framework -**Automatic**: Auto-detects common log patterns -**Cross-platform**: Windows, macOS, Linux -**Lightweight**: Minimal resource usage -**Reliable**: Built-in retry logic and offline storage -**Secure**: Token-based authentication -**Real-time**: Live log monitoring and metrics collection ## System Requirements - Node.js 16.0.0 or higher - Read access to log files - Network access to LogVista central system ## Language-Specific Examples ### Laravel (PHP) ```bash cd my-laravel-app logvista init --name "My Laravel App" logvista start ``` ### ASP.NET Core ```bash cd MyDotNetApp logvista init --name "My .NET App" logvista start ``` ### Django (Python) ```bash cd my-django-project logvista init --name "My Django App" logvista start ``` ### Express.js (Node.js) ```bash cd my-express-app logvista init --name "My Express App" logvista start ``` ### Spring Boot (Java) ```bash cd my-spring-app logvista init --name "My Spring App" logvista start ``` ## Troubleshooting ### No configuration found ```bash # Make sure you're in the project directory cd /path/to/your/project logvista init ``` ### Connection issues ```bash # Check status logvista status # Verify central system URL in config logvista config --show ``` ### Permission issues ```bash # Make sure the agent has read access to log files chmod +r /path/to/logs/*.log ``` ## Support - GitHub: [LogVista Repository] - Documentation: [LogVista Docs] - Issues: [Report Issues] ## License MIT License - see LICENSE file for details.