Installation
Get fapilog running in your Python project.
Quick Install
pip install fapilog
Installation Options
Basic Installation
# Core functionality only
pip install fapilog
With Extras
# FastAPI integration
pip install fapilog[fastapi]
# Metrics exporter (Prometheus client)
pip install fapilog[metrics]
# System metrics helpers (Linux/macOS only)
pip install fapilog[system]
# MQTT integration (reserved)
pip install fapilog[mqtt]
# Development tools
pip install fapilog[dev]
# All extras
pip install fapilog[all]
Optional Extras
Extra |
Description |
Platform |
|---|---|---|
|
FastAPI integration |
All |
|
HTTP sink support |
All |
|
CloudWatch sink |
All |
|
Prometheus metrics |
All |
|
System metrics (CPU, memory) |
Linux, macOS only |
|
PostgreSQL sink |
All |
|
MQTT integration |
All |
|
Development tools |
All |
|
Documentation tools |
All |
Note: The
systemextra requirespsutil, which is excluded on Windows. System metrics enrichers will not function on Windows platforms.
From Source
git clone https://github.com/your-username/fapilog.git
cd fapilog
pip install -e .
Python Version Support
Python Version |
Status |
Notes |
|---|---|---|
3.12 |
✅ Full Support |
Latest stable |
3.11 |
✅ Full Support |
Recommended |
3.10 |
✅ Full Support |
Minimum supported |
3.9 and below |
❌ Not Supported |
Dropped in v0.4.0 |
Dependencies
Required Dependencies
fapilog automatically installs these core dependencies:
pydanticandpydantic-settings- Settings and validationhttpx- HTTP client for webhook/remote sinksorjson- Fast JSON handlingpackaging- Version parsing and compatibility helpers
Optional Dependencies
Install these based on your needs:
# FastAPI integration
pip install fapilog[fastapi]
# Metrics exporter (Prometheus)
pip install fapilog[metrics]
# System metrics helpers
pip install fapilog[system]
# MQTT integration
pip install fapilog[mqtt]
Environment Setup
Virtual Environment (Recommended)
# Create virtual environment
python -m venv venv
# Activate (Unix/macOS)
source venv/bin/activate
# Activate (Windows)
venv\Scripts\activate
# Install fapilog
pip install fapilog
Conda Environment
# Create conda environment
conda create -n fapilog python=3.11
# Activate
conda activate fapilog
# Install
pip install fapilog
Verification
Test your installation:
from fapilog import get_logger
# Should work without errors
logger = get_logger()
print("✅ fapilog installed successfully!")
Troubleshooting
Common Issues
Import Error: No module named ‘fapilog’
# Check if installed
pip list | grep fapilog
# Reinstall if needed
pip install --force-reinstall fapilog
Version Conflicts
# Check for conflicts
pip check fapilog
# Install in clean environment
python -m venv fresh_env
source fresh_env/bin/activate
pip install fapilog
Permission Errors
# Use user installation
pip install --user fapilog
# Or use virtual environment
python -m venv venv
source venv/bin/activate
pip install fapilog
Next Steps
Quickstart - Start logging in 2 minutes
Hello World - Complete walkthrough
Core Concepts - Understand the architecture
Ready to start logging? Move on to the Quickstart.