# π Log Monitoring Application
A Python-based log monitoring tool that parses job log files, calculates processing durations, and flags slow jobs with warnings or errors based on configurable thresholds.
---
## π Features
- β
Parses structured logs with timestamp, job description, PID, and status (`START` / `END`)
- β±οΈ Measures duration between job `START` and `END`
- β οΈ Logs a **warning** if a job takes longer than 5 minutes
- β Logs an **error** if a job takes longer than 10 minutes
- π§ͺ Includes unit tests for robustness
---
## π Log File Format
Each log line must follow this format:
HH:MM:SS,Job Description, START|END, PID
## Log File Format Example:
11:38:33,scheduled task 386, START,10515
11:39:26,background job dej, START,90812
11:40:24,scheduled task 386, END,10515
---
## π Getting Started
### π Requirements
- Python 3.7+
- No external libraries required
### π§ Installation
Clone this repository using below commands:
git clone https://github.com/Jayaram7/lseg-python-logprocessor.git
cd lseg-python-logprocessor
Place your log file in the project directory as `logs.log` or modify the script to use a custom filename.
---
## π Usage
Run the main script:
`python log_monitor.py`
---
## π§ͺ Running Tests
Unit tests are included in `test_log_monitor.py`.
To run tests:
`python -m unittest test_log_monitor.py`
---
## π File Structure
βββ logs.log # Sample or real log file
βββ log_monitor.py # Main processing script
βββ test_log_monitor.py # Unit tests for the application
----
Notifications
You must be signed in to change notification settings - Fork 0
Jayaram7/lseg-python-logprocessor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published