Skip to content

Quick Start

Get Lumberjack up and running in your Python project in just a few minutes.

The fastest way to get started:

Terminal window
uv add 'lumberjack-sdk[local-server]' && uv run lumberjack claude init

This will:

  • Install the lumberjack MCP locally with claude
  • Optionally kick off a claude session with a pre-filled prompt to instrument the library for you

If you prefer to set up manually:

  • Python 3.10 or higher
Terminal window
# Install with local development server
uv add 'lumberjack_sdk[local-server]'
Terminal window
# Install with local development server
pip install 'lumberjack_sdk[local-server]'

Add Lumberjack to your Python application:

from lumberjack_sdk import Lumberjack
import logging
# Initialize Lumberjack
Lumberjack.init(
project_name="my-app",
# Local server is auto-discovered!
)
# Use standard Python logging
logging.info("Application started")
logging.debug("Debug information")
logging.warning("Something might be wrong")
logging.error("An error occurred")

2. Enable Local Server (Environment Variable)

Section titled “2. Enable Local Server (Environment Variable)”

Add this to your .env file or environment:

Terminal window
LUMBERJACK_LOCAL_SERVER_ENABLED=true

This ensures logs are forwarded to the local development server.

First, start the Lumberjack local development server:

Terminal window
uv run lumberjack serve
# or: lumberjack serve (if installed with pip)

The server will start on http://localhost:8080 and automatically open in your browser.

Tip: You can just leave this server running. The SDK will auto-discover it whenever you start up your dev server.

from flask import Flask
from lumberjack_sdk import Lumberjack, LumberjackFlask
import logging
app = Flask(__name__)
# Initialize Lumberjack
Lumberjack.init(project_name="my-flask-app")
# Auto-instrument Flask
LumberjackFlask.instrument(app)
@app.route('/')
def hello():
logging.info("Hello endpoint called")
return "Hello, World!"
from fastapi import FastAPI
from lumberjack_sdk import Lumberjack, LumberjackFastAPI
import logging
app = FastAPI()
# Initialize Lumberjack
Lumberjack.init(project_name="my-fastapi-app")
# Auto-instrument FastAPI
LumberjackFastAPI.instrument(app)
@app.get("/")
async def root():
logging.info("Root endpoint called")
return {"message": "Hello World"}

In your settings.py:

from lumberjack_sdk import Lumberjack, LumberjackDjango
# Initialize Lumberjack
Lumberjack.init(
project_name="my-django-app"
)
# Instrument Django
LumberjackDjango.instrument()

Once everything is set up:

  1. Open http://localhost:8080 in your browser
  2. You’ll see all your logs in real-time
  3. Use filters to search by level, service, or content