A Streamlit-based web application that uses Google's Gemini AI to analyze test log files and provide intelligent summaries of test failures, root causes, and suggested solutions.
- AI-Powered Analysis: Uses Google Gemini 2.5 Pro to analyze log files
- Intelligent Summarization: Extracts key information including test name, device, status, root cause, and solutions
- User-Friendly Interface: Clean, intuitive Streamlit web interface
- Visual Status Indicators: Color-coded status badges (PASS/FAIL)
- Python 3.7 or higher
- Google Gemini API key
-
Clone the repository
git clone https://github.com/ElzaJose/LogAnalyzerAI.git cd LogAnalyzerAI -
Install dependencies
pip install -r requirements.txt
-
Set up your API key
You need to obtain a Google Gemini API key and set it as an environment variable.
Option 1: Environment Variable (Recommended)
export GEMINI_API_KEY="your_api_key_here"
Option 2: Add to your shell profile
echo 'export GEMINI_API_KEY="your_api_key_here"' >> ~/.bashrc source ~/.bashrc
- Go to Google AI Studio
- Sign in with your Google account
- Click on "Get API Key"
- Create a new API key
- Copy the generated API key
-
Start the application
streamlit run logAnalyzer.py
-
Access the web interface
- The application will automatically open in your default browser
- If not, navigate to
http://localhost:8501
-
Upload and analyze logs
- Click "Choose a test log file"
- Select a
.txtlog file - Wait for AI analysis
- View the formatted summary report
The application is configured to use Google Gemini 2.5 Pro model. Key configuration parameters:
- Model:
gemini-2.5-pro - API Key: Set via
GEMINI_API_KEYenvironment variable - Input: Text files (
.txtformat) - Output Format: Structured summary with predefined fields
You can modify the analysis prompt in logAnalyzer.py around line 25. The current prompt structure extracts:
- TESTNAME: Name of the test
- DEVICE: Device information
- STATUS: Test status (PASS/FAIL)
- ROOT CAUSE: Why the test failed (max 2 sentences)
- SOLUTION: Suggested fix or next steps
The AI analyzer provides structured output in the following format:
TESTNAME: Example Test Name
DEVICE: Test Device Model
STATUS: FAILED
ROOT CAUSE: Brief explanation of why the test failed
SOLUTION: Suggested resolution steps
- streamlit: Web application framework
- google-generativeai: Google Gemini AI integration
- os: Environment variable handling (built-in)
- re: Regular expressions for text formatting (built-in)
-
API Key Error
⚠️ GEMINI_API_KEY not found in environment variables.Solution: Ensure your API key is properly set as an environment variable
-
File Upload Issues
- Only
.txtfiles are supported - Ensure your log file is in plain text format
- The app does not support huge log files
- Only
-
Model Connection Issues
- Check your internet connection
- Verify your API key is valid and has quota remaining
To run in debug mode with verbose output:
streamlit run logAnalyzer.py --logger.level=debugContributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.
This project is licensed under the MIT License
- Support for multiple log file formats (CSV, JSON, XML)
- Support huge log files
- Batch processing of multiple log files
- Export analysis results to PDF/Excel
- Custom prompt templates
- Integration with other LLM providers
- Historical analysis tracking
- Advanced filtering and search capabilities

