Interactive desktop tool for analyzing, filtering, and visualizing large log files. Built with Python and PyQt5.
- Fast Loading: Background processing for large log files without freezing the UI
- Multiple Formats: Support for both text and JSON log files
- Advanced Filtering: Filter logs by:
- Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
- Time range
- Source/Logger
- Regex pattern matching
- Anomaly detection
- Timeline Visualization: Interactive timeline chart showing log activity over time
- Statistics Dashboard: Comprehensive statistics with charts:
- Log level distribution (pie chart)
- Top log sources (bar chart)
- Error distribution
- Summary metrics
- Anomaly Highlighting: Automatic detection and highlighting of errors and anomalies
- Export Functionality: Export filtered results to CSV, JSON, or text formats
- Modern UI: Clean, responsive interface with color-coded log levels
- Clone the repository:
git clone https://github.com/BaseMax/qt-log-analyzer.git
cd qt-log-analyzer- Install dependencies:
pip install -r requirements.txtRun the application:
python main.py- Open Log File: Click "📁 Open Log File" button and select a log file (.log, .txt, or .json)
- View Logs: Browse logs in the table view with color-coded levels
- Apply Filters: Use the filter panel to narrow down logs:
- Select specific log level
- Choose source/logger
- Set time range
- Enter regex pattern for message search
- Enable "Anomalies Only" to see detected issues
- View Timeline: Switch to "Timeline" tab to see log activity over time
- View Statistics: Switch to "Statistics" tab for detailed analytics
- Export Results: Click "💾 Export Filtered" to save filtered logs
Sample log files are provided in the sample_logs/ directory:
sample.log: Text format log filesample.json: JSON format log file
The analyzer supports multiple text log formats:
# Format 1: Timestamp - Level - Message
2024-01-15 10:23:45 - INFO - Application started
# Format 2: [Timestamp] Level: Message
[2024-01-15 10:23:45] INFO: Application started
# Format 3: Timestamp Source Level: Message
2024-01-15 10:23:45 app.main INFO: Application started
# Format 4: Level Timestamp [Source] Message
INFO 2024-01-15 10:23:45 [app.main] Application started
JSON logs should have one JSON object per line:
{"timestamp": "2024-01-15T10:23:45", "level": "INFO", "source": "app.main", "message": "Application started"}Supported fields:
timestamportime: Timestamp stringlevelorseverity: Log levelsourceorlogger: Source/logger namemessageormsg: Log message
- log_parser.py: Parses text and JSON log files
- log_filter.py: Filters log entries based on criteria
- log_statistics.py: Calculates statistics and metrics
- timeline_widget.py: Timeline visualization widget
- statistics_widget.py: Statistics dashboard widget
- main.py: Main application and GUI
Large files are loaded in a background thread to prevent UI freezing. Progress is shown in a progress bar.
Automatic detection of anomalies using heuristics:
- All ERROR and CRITICAL level logs
- Frequently occurring errors
Log levels are color-coded for easy identification:
- DEBUG: Gray
- INFO: Green
- WARNING: Orange
- ERROR: Red
- CRITICAL: Dark Red
- Python 3.7+
- PyQt5 5.15.0+
- matplotlib 3.5.0+
- pandas 1.3.0+
- python-dateutil 2.8.0+
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
BaseMax



