https://github.com/imshakil/logpulse
A Flask-based web application for real-time log monitoring and management across multiple directories.
https://github.com/imshakil/logpulse
flask flask-sqlalchemy logging monitoring postgresql python3
Last synced: 7 months ago
JSON representation
A Flask-based web application for real-time log monitoring and management across multiple directories.
- Host: GitHub
- URL: https://github.com/imshakil/logpulse
- Owner: imShakil
- License: apache-2.0
- Created: 2024-11-19T15:01:03.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-18T03:48:45.000Z (7 months ago)
- Last Synced: 2025-03-18T04:27:03.050Z (7 months ago)
- Topics: flask, flask-sqlalchemy, logging, monitoring, postgresql, python3
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LogPulse
A Flask-based web application for real-time log monitoring and management across multiple directories.
## Features
- Real-time log streaming
- Multi-directory log monitoring
- Secure authentication (Local DB and/or API)
- Download logs functionality
- Session management## Prerequisites
- Python 3.8 or higher
- PostgreSQL (for local authentication)
- pip (Python package manager)## Installation
1. Clone the repository:
```bash
git clone https://github.com/imShakil/LogPulse.git
cd LogPulse
```2. Create and activate a virtual environment:
```bash
python -m venv venv
source venv/bin/activate
```3. Install dependencies:
```bash
pip install -r requirements.txt
```4. Configure environment variables:
```bash
cp .env.example .env # Rename to .env and update the value as needed
```## Running the Application
1. Using Python directly:
```bash
python report.py
```2. Using PM2 (Recommended for production):
```bash
# Install PM2 if not installed
npm install pm2 -g# Start using ecosystem config
pm2 start ecosystem.config.js# Other useful PM2 commands
pm2 status # Check application status
pm2 logs logpulse # View logs
pm2 restart logpulse # Restart application
pm2 stop logpulse # Stop application
pm2 delete logpulse # Remove from PM2# For production environment
pm2 start ecosystem.config.js --env production
```3. Access the application in your web browser at `http://localhost:5000`
Note: The application includes a PM2 ecosystem configuration file [`ecosystem.config.js`](./ecosystem.config.js) that handles:
- Python interpreter settings
- Instance management
- Auto-restart capability
- Memory limits
- Environment-specific configurations## Authentication Modes
1. Local Database (MODE 0)
- Uses PostgreSQL for user authentication
- Requires database configuration
- Default user: `admin`, password: `admin123` if no password is set on environment variable2. API Authentication (MODE 1)
- Uses external API for authentication
- Requires valid API endpoint configuration3. Hybrid Mode (MODE 2)
- Attempts API authentication first
- Falls back to local database if API fails## Directory Structure
```plaintext
LogPulse/
├── auth/
│ └── auth.py
├── services/
│ ├── logger.py
│ ├── log_manager.py
│ ├── log_stream_reader.py
│ └── log_download.py
| └── log_directory.py
| └── file_system_log_directory.py
├── static/
│ └── css/
│ └── style.css
├── templates/
│ ├── login.html
│ └── log_viewer.html
├── .env
├── requirements.txt
└── logpulse.py
```## Security Considerations
- Secure log access
- Use HTTPS in production
- Use environment variables for sensitive data## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) for details.