Files
LogMaster/README.md
Kevin a7aa549972
Some checks failed
Docker Build & Push / build (push) Failing after 3s
LogMaster CI/CD / build-and-test (push) Has been cancelled
LogMaster CI/CD / docker (push) Has been cancelled
Fix Dockerfile merge conflict add registry docs to README
2026-05-29 19:21:23 +02:00

105 lines
3.3 KiB
Markdown

# Log Viewer
A powerful log management tool with four operating modes: Viewer, Collector, Monitor, and combined. Features web UIs, S3 integration, UDP ingestion, log rotation, pattern-based alerting, and multi-channel notifications.
## Quick Start
```bash
npm install
npm run build
node dist-server/server.js
```
Open http://localhost:8080 in your browser.
## Docker Registry
The container image is hosted at `git.kgessner.de/keviin/logmaster`.
### Build and push (for CI/CD or manual updates)
```bash
# 1. Build the image
docker build -t git.kgessner.de/keviin/logmaster:latest .
# 2. Login to Gitea registry (token: 2c3ea75b8936818174770592d217a3b6bfdbb4cd)
echo 2c3ea75b8936818174770592d217a3b6bfdbb4cd | docker login git.kgessner.de -u Keviin --password-stdin
# 3. Push
docker push git.kgessner.de/keviin/logmaster:latest
```
### Pull and run
```bash
docker pull git.kgessner.de/keviin/logmaster:latest
docker run -d -p 8080:8080 -e LOG_MODE=both git.kgessner.de/keviin/logmaster:latest
```
## Modes
| Mode | Command | Port | Description |
|------|---------|------|-------------|
| Both (default) | `node dist-server/server.js` | 8080 | Viewer + Collector |
| Viewer | `cp .env.viewer .env && node dist-server/server.js` | 9090 | Read & display logs |
| Collector | `cp .env.collector .env && node dist-server/server.js` | 8081 | Receive & store logs |
| Monitor | `cp .env.monitor .env && node dist-server/server.js` | 8082 | Scan & alert on patterns |
## Docker
```bash
docker pull git.kgessner.de/keviin/logmaster:latest
docker run -d -p 8080:8080 git.kgessner.de/keviin/logmaster:latest
```
**Wichtig:** Collector-Daten liegen im Container unter `/app/collector-data/`. Ohne Volume-Mount gehen diese bei Neustart verloren:
```bash
docker run -d -p 8080:8080 \
-v ./collector-data:/app/collector-data \
-v ./monitor-data:/app/monitor-data \
git.kgessner.de/keviin/logmaster:latest
```
**Health Check:** Der Container hat einen eingebauten HEALTHCHECK auf `/api/health`. Manuell prüfbar mit:
```bash
curl http://localhost:8080/api/health
```
## Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `LOG_MODE` | `both` | Mode: `viewer`, `collector`, `monitor`, `both`, `all` |
| `PORT` | `8080` | HTTP port |
| `HOST` | `0.0.0.0` | Bind address |
| `LOG_SOURCES` | _(empty)_ | Comma-separated file paths |
| `COLLECTOR_UDP_PORT` | `5140` | UDP syslog port |
| `MONITOR_ENABLED` | `true` | Enable monitor scanning |
| `MONITOR_SCAN_INTERVAL` | `60000` | Scan interval in ms |
| `MONITOR_RULES` | `[]` | JSON array of monitor rules |
| `REMOTE_COLLECTOR_URL` | _(empty)_ | URL to remote collector (viewer mode) |
## Documentation
- **[Full Documentation](DOCS.md)** — Complete reference
- **[Viewer Guide](docs/VIEWER.md)** — How to use the log viewer
- **[Collector Guide](docs/COLLECTOR.md)** — How to set up log collection
- **[Monitor Guide](docs/MONITOR.md)** — How to configure pattern alerts
## Features
- Multi-source: local files, gzip/bz2/xz/zst, S3, UDP, HTTP
- Real-time log streaming with live highlighting
- Regex search with level filtering
- Log rotation (size + time based, with compression)
- Forward to HTTP, file, UDP, or console
- Pattern monitoring with Telegram, Webhook, Teams, Email alerts
- Scheduled scans (continuous, daily, hourly)
- Dark/Light theme, keyboard shortcuts, export
## License
MIT