Python-based log intelligence and analysis tool for importing, storing, analysing, and reporting operational application logs through a modular FastAPI backend.
アプリケーションログの取り込み、保存、分析、レポート生成を行う、FastAPIベースのログインテリジェンス・分析ツールです。
LogSense is a FastAPI and PostgreSQL application for importing, storing, analysing, and reporting operational application logs.
- FastAPI API layer
- PostgreSQL log storage
- SQLAlchemy database integration
- Log importing and persistence
- Stored log retrieval
- Log severity summaries
- Error analysis and reporting
- Live log preview endpoint
- Docker support
- Docker Compose API + PostgreSQL environment
- Swagger API documentation
- GitHub Actions backend CI
- Repeated calls to
/logs/importcan create duplicate stored log entries.
- Prevent duplicate log imports
- Add a small read-only LogSense dashboard for log summaries and analysis
- Complete project documentation
- Capture final screenshots and presentation material
- Move LogSense to maintenance
| EN | 日本語 |
|---|---|
| Log severity categorisation | ログの重要度分類 |
| INFO / WARNING / ERROR detection | INFO / WARNING / ERROR の検出 |
| Repeated error tracking | 重複エラーの追跡 |
| Error frequency analysis | エラー発生頻度の分析 |
| Timestamp and hour-based error analysis | タイムスタンプ・時間帯別のエラー分析 |
| Exportable analysis reports | エクスポート可能な分析レポート |
| Colour-coded CLI output | 色分けされたCLI出力 |
| PostgreSQL log persistence | PostgreSQLへのログ保存 |
| Log import and retrieval API | ログのインポート・取得API |
| Live log preview endpoint | 最新ログのライブプレビュー |
| FastAPI REST API | FastAPI REST API |
| Swagger API documentation | Swagger APIドキュメント |
| Dockerised development environment | Docker開発環境 |
| Modular backend architecture | モジュール化されたバックエンド構成 |
- Python
- FastAPI
- Uvicorn
- SQLAlchemy
- PostgreSQL
- Docker
- Docker Compose
- Git
- GitHub
- GitHub Actions CI
- Colorama
- Modular service and route structure
- REST API
- PostgreSQL persistence
Start the FastAPI backend and Postgresql database:
docker compose up --buildRun in the background:
docker compose up -dView container logs:
docker compose logsStop the container:
docker compose downBuild the API container:
docker build -t logsense .Run the API container:
docker run -p 8000:8000 logsense-apiOpen FastAPI Swagger docs:
http://127.0.0.1:8000/docs
| Method | Endpoint | Description |
|---|---|---|
| GET | / | API health/status route |
| GET | /logs/summary | Returns log severity summary |
| GET | /logs/errors | Returns error log entries |
| GET | /logs/report | Returns generated analysis report |
| POST | /logs/import | Imports log entries into PostgreSQL |
| GET | /logs/stored | Returns stored log entries from PostgreSQL |
| GET | /logs/live | Returns the latest log entries from the log file |
| DELETE | /logs/stored | Clears stored log entries from PostgreSQL |
Import logs:
curl -X POST http://127.0.0.1:8000/logs/importView stored logs:
curl http://127.0.0.1:8000/logs/storedView severity summary
LogSense uses GitHub Actions for automated backend checks on pushes and pull requests.
The current CI workflow:
- Checks out the repository
- Sets up the Python environment
- Installs project dependencies
- Validates the backend
- Runs available tests
- Builds the Docker image when a Dockerfile is present
Deployment is separate from the current GitHub Actions CI workflow.
logsense/
├── app/
│ ├── main.py
│ ├── database.py
│ ├── models/
│ │ └── log_model.py
│ ├── routes/
│ │ └── log_routes.py
│ └── services/
│ └── log_service.py
├── sample_logs/
│ └── server.log
├── analytics.py
├── analyzer.py
├── parser.py
├── reporter.py
├── analysis_report.txt
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md
Detailed project documentation is available in the docs/ directory.
| Document | Description |
|---|---|
| API Examples | Example requests for interacting with the LogSense API |
| Architecture | Coming during finalisation |
| Development Notes | Coming during finalisation |
LogSense is approaching feature completion. Remaining work is intentionally limited to:
| EN | 日本語 |
|---|---|
| Prevent duplicate log imports | 重複ログ登録の防止 |
| Add a small read-only analysis dashboard | 読み取り専用の分析ダッシュボードを追加 |
| Complete architecture and development documentation | アーキテクチャ・開発ドキュメントの完成 |
| Capture final screenshots and presentation material | 最終スクリーンショット・紹介資料の作成 |
| Move the project to maintenance | プロジェクトをメンテナンス段階へ移行 |
Once these items are complete, further development will be limited to maintenance, dependency updates, bug fixes, and documentation improvements.