Skip to content
Edit this page

Installation

Prerequisites

  • Python: 3.10 or higher
  • Operating System: Windows, macOS, or Linux
  • pip: Latest version recommended

Install from PyPI

The easiest way to install Logly is from PyPI:

pip install logly
uv pip install logly
poetry add logly
pipenv install logly

Verify Installation

After installation, verify that Logly is working correctly:

from logly import logger

# NEW in v0.1.5: No configuration needed!
logger.info("Logly installed successfully!")  # ✅ Works immediately
logger.complete()

You should see:

2025-10-05 10:30:45 | INFO     | Logly installed successfully!

Why it works immediately: - Logger is auto-configured on import (since v0.1.5) - Default settings: console=True, auto_sink=True - No need to call configure() before logging - File sinks are NEVER automatic - add with logger.add("file.log")


Version Information

Check the installed version:

import logly
print(logly.__version__)  # e.g., "0.1.2"

Output:

0.1.2


Platform-Specific Installation

Windows

python -m pip install --upgrade pip
pip install logly

macOS

python3 -m pip install --upgrade pip
pip3 install logly

Linux

python3 -m pip install --upgrade pip
pip3 install logly

Install from Source

For developers or users who want the latest development version:

Prerequisites for Building

  • Python: 3.10+
  • Rust: 1.70+ (Install Rust)
  • maturin: Python package for building Rust extensions

Build Steps

# Clone repository
git clone https://github.com/muhammad-fiaz/logly.git
cd logly

# Install with uv (recommended)
uv pip install -e .
# Clone repository
git clone https://github.com/muhammad-fiaz/logly.git
cd logly

# Install maturin
pip install maturin

# Build in development mode
maturin develop

# Run tests
pytest
# Clone repository
git clone https://github.com/muhammad-fiaz/logly.git
cd logly

# Install maturin
pip install maturin

# Build wheel
maturin build --release

# Install wheel
pip install target/wheels/logly-*.whl

Docker Installation

For containerized environments:

Dockerfile Example

FROM python:3.12-slim

# Install logly
RUN pip install --no-cache-dir logly

# Copy application
COPY . /app
WORKDIR /app

# Run application
CMD ["python", "app.py"]

Docker Compose

version: '3.8'

services:
  app:
    image: python:3.12-slim
    volumes:
      - ./:/app
      - ./logs:/app/logs
    working_dir: /app
    command: >
      sh -c "pip install logly && python app.py"

Virtual Environments

It's recommended to use virtual environments:

# Create virtual environment
python -m venv venv

# Activate (Windows)
venv\Scripts\activate

# Activate (Unix/macOS)
source venv/bin/activate

# Install logly
pip install logly
# Create conda environment
conda create -n myproject python=3.12

# Activate environment
conda activate myproject

# Install logly
pip install logly
# Create project with uv
uv init myproject
cd myproject

# Add logly
uv add logly

# Run application
uv run python app.py

Troubleshooting

Import Error

If you encounter import errors:

ImportError: cannot import name 'logger' from 'logly'

Output:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    ImportError: cannot import name 'logger' from 'logly'

Solution: Ensure you're using Python 3.10+:

python --version  # Should be >= 3.10
pip install --upgrade logly

Output:

Python 3.12.0
Collecting logly
  Downloading logly-0.1.2.tar.gz (15 kB)
Successfully installed logly-0.1.2

Build Errors (Source Installation)

If building from source fails:

  1. Install Rust toolchain:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    

  2. Update maturin:

    pip install --upgrade maturin
    

  3. Clean and rebuild:

    cargo clean
    maturin develop --release
    

Permission Errors

On Unix systems, if you get permission errors:

# Use --user flag
pip install --user logly

# Or use sudo (not recommended)
sudo pip install logly

Upgrade

To upgrade to the latest version:

pip install --upgrade logly

Check release notes: Changelog


Uninstall

To remove Logly:

pip uninstall logly

System Requirements

Component Minimum Recommended
Python 3.10 3.11+
RAM 50 MB 100 MB+
Disk 5 MB 10 MB+
CPU Any Multi-core for async

Next Steps

Now that Logly is installed, check out the Quick Start Guide to start logging!


Need Help?