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

FastAPI integration

All

http

HTTP sink support

All

aws

CloudWatch sink

All

metrics

Prometheus metrics

All

system

System metrics (CPU, memory)

Linux, macOS only

postgres

PostgreSQL sink

All

mqtt

MQTT integration

All

dev

Development tools

All

docs

Documentation tools

All

Note: The system extra requires psutil, 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:

  • pydantic and pydantic-settings - Settings and validation

  • httpx - HTTP client for webhook/remote sinks

  • orjson - Fast JSON handling

  • packaging - 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

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


Ready to start logging? Move on to the Quickstart.