A modern web-based log viewer with syntax highlighting and AI-powered analysis capabilities. Built with Python Flask backend and React frontend.
- Multi-format Log Support: Automatically detects and parses syslog, Apache access logs, Kubernetes logs, MySQL logs, and more
- Syntax Highlighting: Beautiful color-coded display for both parsed and raw log views
- AI Analysis: Powered by DeepSeek LLM for intelligent log analysis and issue detection
- Modern UI: Responsive design with drag-and-drop upload, search, and filtering
- Real-time Processing: Automatic log parsing and structured data extraction
- Automatic issue detection (errors, warnings, security concerns)
- Performance bottleneck identification
- Configuration problem analysis
- Pattern recognition and anomaly detection
- Actionable recommendations
- Custom question analysis
- Demo mode when API key not configured
- Syslog (RFC3164): System logs from Linux/Unix systems
- Apache Access Logs: Web server access logs in Common Log Format
- Kubernetes Logs: Container orchestration platform logs
- MySQL Logs: Database server logs
- Docker Logs: Container runtime logs
- Generic Text Logs: Any text-based log format
- Framework: Flask with SQLAlchemy ORM
- Database: SQLite (easily configurable for PostgreSQL/MySQL)
- AI Integration: DeepSeek API (OpenAI-compatible)
- Log Processing: Custom parsers for different log formats
- API: RESTful endpoints for file upload, parsing, and analysis
- Framework: React 18 with Vite build tool
- UI Library: Tailwind CSS + shadcn/ui components
- Syntax Highlighting: react-syntax-highlighter library
- File Upload: react-dropzone for drag-and-drop functionality
- State Management: React hooks and context
- Python 3.11+
- Node.js 18+
- npm or pnpm
cd log-viewer-backend
source venv/bin/activate
pip install -r requirements.txt
# Set up environment variables (optional for AI features)
export DEEPSEEK_API_KEY="your-deepseek-api-key"
# Run the backend server
python src/main.pyThe backend will start on http://localhost:5001
cd log-viewer-frontend
pnpm install
# Run the development server
pnpm run devThe frontend will start on http://localhost:5174
To enable AI analysis features:
- Get a DeepSeek API key from https://platform.deepseek.com/
- Set the environment variable:
export DEEPSEEK_API_KEY="your-api-key-here"
- Restart the backend server
Without the API key, the application runs in demo mode with mock analysis results.
- Navigate to the "Upload & Manage" tab
- Drag and drop log files or click to browse
- Supported formats: .log, .txt, .out, .err, .json (up to 100MB)
- Files are automatically processed and parsed
- Click "View" on any uploaded file
- Switch to "Log Viewer" tab
- Choose between "Parsed" (structured) or "Raw" (syntax highlighted) views
- Use search and filtering to find specific entries
- Select text in the log viewer by highlighting it
- Click the "Analyze" button that appears
- Choose from suggested analysis topics or ask custom questions
- View detailed analysis results with recommendations
- Text Search: Find specific terms across all log entries
- Level Filtering: Filter by log levels (INFO, WARNING, ERROR, etc.)
- Time Range: Navigate through chronological log entries
- Source Filtering: Filter by log source/component
POST /api/logs/upload- Upload log filesGET /api/logs/files- List uploaded filesGET /api/logs/files/{id}- Get file detailsGET /api/logs/files/{id}/entries- Get parsed log entriesDELETE /api/logs/files/{id}- Delete file
POST /api/parser/process/{id}- Process/reprocess log fileGET /api/parser/formats- Get supported log formats
POST /api/analysis/analyze- Analyze selected textGET /api/analysis/suggestions/{id}- Get analysis suggestionsGET /api/analysis/config- Get AI configuration statusGET /api/analysis/history/{id}- Get analysis history
log-viewer-backend/
├── src/
│ ├── main.py # Flask application entry point
│ ├── models/ # Database models
│ ├── routes/ # API route handlers
│ ├── parsers/ # Log format parsers
│ └── services/ # Business logic services
└── requirements.txt
log-viewer-frontend/
├── src/
│ ├── App.jsx # Main application component
│ ├── components/ # React components
│ └── assets/ # Static assets
├── package.json
└── vite.config.js
- Create a new parser in
backend/src/parsers/ - Add format detection logic in
log_parser.py - Update the supported formats list in the frontend
- Modify
ai_analyzer.pyto add new analysis types - Update the analysis routes in
routes/analysis.py - Enhance the frontend AI panel for new features
- File uploads are validated and stored securely
- API keys are handled through environment variables
- SQL injection protection through SQLAlchemy ORM
- CORS properly configured for cross-origin requests
- File size limits enforced (100MB default)
- Pagination for large log files
- Efficient parsing with streaming for large files
- Database indexing on frequently queried fields
- Frontend virtualization for large log displays
- Caching of parsed results
Backend not starting:
- Check Python version (3.11+ required)
- Ensure all dependencies are installed
- Verify database permissions
Frontend not loading:
- Check Node.js version (18+ required)
- Clear npm/pnpm cache:
pnpm store prune - Verify backend is running on port 5001
AI analysis not working:
- Verify DEEPSEEK_API_KEY is set correctly
- Check API key validity at DeepSeek platform
- Review backend logs for API errors
File upload failing:
- Check file size (100MB limit)
- Verify file format is supported
- Ensure backend storage directory is writable
This project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
For issues and questions:
- Check the troubleshooting section above
- Review the API documentation
- Submit issues on the project repository