Modern web-based log analysis tool for Nextcloud Server and Client logs with intelligent root cause detection.
- π€ Root Cause Detection - Automatically identifies common issues:
- π΄ Redis connection errors and cluster failures
- πΎ S3/ObjectStore problems (503 errors, connection issues)
- π WebDAV protocol errors
- π PHP errors (fopen, TypeError detection)
- π File locking problems
- π Client sync errors (404, 403, network failures)
- π Click-to-Filter - Click any root cause card to instantly filter affected logs
- π¨ Severity Levels - Color-coded cards (Critical/High/Medium/Low)
- π‘ Solution Suggestions - Specific troubleshooting steps for each issue
- π‘οΈ CORS Protection - Configurable allowed origins (no more wildcards)
- π¦ Rate Limiting - DoS protection (5 uploads/min, 30 API calls/min)
- π API Key Auth - Optional authentication for production
- ποΈ Auto-Cleanup - Automatic deletion of old results (7 days default)
- π Size Limits - Enforced file size and type validation
- See SECURITY.md for complete security guide
- π Multi-File Upload - Analyze up to 15 files simultaneously (2GB limit per file)
- π¦ ZIP Archive Support - Direct upload of Nextcloud client debug.zip files
- ποΈ Compression Support - Direct processing of
.gz/.gzipfiles - π Smart Filters - Date range, username, search text, category filters
- π± Responsive Design - Works on desktop, tablet, and mobile
- π Interactive Charts - Visual statistics with Chart.js
- π Dual Format Support - JSON (Server) and Text (Client) logs
- β‘ High Performance - FastAPI backend with async processing
- π³ Docker Ready - One-command deployment
- π Dark Mode Toggle - Switch between light and dark themes
- πΎ Download Results - Export as JSON or CSV
- π¨ Enhanced Drag & Drop - Visual feedback with file counter
- Smooth Animations - Professional transitions and effects
- Pagination - 100 entries per page for optimal performance
# Using Docker Compose
docker-compose up -d
# Or using the start script
./start-web.sh # Linux/macOS
start-web.ps1 # WindowsAccess: http://localhost:8000
See docs/DOCKER.md for detailed Docker documentation
Requirements:
- Python 3.11+ (3.11, 3.12 tested, 3.13 not yet supported due to pydantic-core compatibility)
- pip
Setup:
# 1. Clone repository
git clone https://github.com/xXRoxXeRXx/log-scanner.git
cd log-scanner
# 2. Install dependencies
pip install -r requirements.txt
# 3. Start server
cd backend
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000Access: http://localhost:8000
Drag & Drop:
- Drag one or multiple log files into the upload area
- Visual feedback shows file count during drag
File Selector:
- Click "Choose Files" button
- Select up to 15 files (max 2GB per file)
Supported Formats:
- Server Logs - JSON format from Nextcloud server
- Client Logs - Text format from desktop/mobile clients
- Compressed - Automatic
.gzdecompression - ZIP Archives - Auto-extract Nextcloud client debug.zip
Root Cause Analysis:
- Automatically appears at the top if issues detected
- Color-coded cards show severity and frequency
- Click any card to filter affected logs
Statistics Overview:
- Total entries and category breakdown
- Interactive pie chart
- Only non-zero categories displayed
Log Entries:
- Paginated table (100 per page)
- Date, time, type, user, error code, message
- Type-based color coding
Available Filters:
- Date Range - From/To date picker
- Username - Select specific user
- Search - Free text search in messages
- Category - Filter by log category
Quick Filter:
- Click any root cause card to auto-filter
- Shows only affected log entries
- πΎ JSON - Download complete analysis as JSON
- π CSV - Export filtered entries as CSV spreadsheet
Create a .env file (copy from .env.example):
# Security
ALLOWED_ORIGINS=http://localhost:8000
ENABLE_AUTH=false
API_KEY=your-super-secret-key-here
# Rate Limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_UPLOAD=5/minute
RATE_LIMIT_API=30/minute
# File Limits
MAX_FILE_SIZE_MB=2048
MAX_FILES=15
# Cleanup
AUTO_CLEANUP_ENABLED=true
RESULT_RETENTION_DAYS=7
# Timeouts
UVICORN_TIMEOUT_KEEP_ALIVE=300
REQUEST_TIMEOUT=600See .env.example for complete documentation
log-scanner/
βββ backend/ # FastAPI application
β βββ static/ # Frontend (HTML/CSS/JS)
β β βββ index.html # Upload page
β β βββ results.html # Analysis results
β βββ main.py # API endpoints
βββ shared/ # Shared parsers
β βββ web_parser.py # Main analysis logic
β βββ server_parser.py # Server log parser
β βββ client_parser.py # Client log parser
β βββ data_store.py # Data management
βββ tests/ # Test suite (44 tests)
βββ docs/ # Documentation
β βββ DOCKER.md # Docker guide
β βββ CHANGELOG-SECURITY.md
βββ logs/ # Application logs
βββ uploads/ # Uploaded files (temp)
βββ results/ # Analysis results
βββ Dockerfile # Docker build
βββ docker-compose.yml # Docker orchestration
βββ requirements.txt # Python dependencies
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=backend --cov=shared --cov-report=html
# Run specific test file
pytest tests/test_security_features.py -vTest Suite:
- 44 tests covering parsers, API, and security
- Security tests for CORS, rate limiting, auth
- Integration tests for file upload and analysis
- See
.github/workflows/ci-cd.ymlfor CI/CD
Problem: Large files (>100MB) timeout during upload
Solution: Timeouts are set to 10 minutes (frontend) and 5 minutes (backend keep-alive)
- Should handle files up to 500MB
- For larger files, use local development mode
Problem: Only some log entries shown in results
Solution: Fixed in v2.0.3 - all entry categories now displayed
Problem: Tests fail on Python 3.13 with pydantic-core error
Solution: Use Python 3.11 or 3.12 until pydantic-core adds 3.13 support
This project follows security best practices:
- β No wildcard CORS
- β Rate limiting on all endpoints
- β Optional API key authentication
- β Automatic cleanup of old data
- β Input validation and sanitization
- β Size limits enforced
See SECURITY.md for:
- Security policy
- Vulnerability reporting
- Supported versions
- Security features
- Version: 2.0.3
- Lines of Code: ~3,000
- Test Coverage: 85%+
- Test Suite: 44 tests
- Docker Image: ~200MB
- Supported Formats: .log, .txt, .json, .gz, .zip
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- All tests pass (
pytest tests/) - Code follows project style
- Security features are not compromised
- β¨ Added Dark Mode toggle with localStorage persistence
- πΎ Added download results as JSON/CSV
- π¨ Enhanced drag & drop feedback with file counter
- π Fixed server_info entries not being returned
- π§ Consolidated logs/uploads/results to absolute paths
- π Reorganized documentation structure
- π Added upload progress bar (0-100%)
- β±οΈ Increased upload timeout to 10 minutes
- β‘ Improved large file handling (up to 500MB)
- π Comprehensive security hardening
- π‘οΈ CORS protection (no more wildcards)
- π¦ Rate limiting (DoS protection)
- π Optional API key authentication
- ποΈ Auto-cleanup of old results
- π§ͺ Added 22 security tests
- π CI/CD pipeline with 5 jobs
See docs/CHANGELOG-SECURITY.md for detailed security changes
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI - Modern, fast web framework
- Alpine.js - Lightweight reactive framework
- Chart.js - Beautiful charts
- Docker - Containerization platform
- Nextcloud Community - For the awesome platform
β If you find this project useful, please give it a star on GitHub! β