⚡ 63ns/op • 0 allocations • 64% faster than Zerolog

Zero-Allocation Structured Logging for Go

Ultra-fast, production-ready logging library that delivers exceptional performance without compromising on features. Built for modern Go applications that demand both speed and observability.

Why Choose Bolt?

Built from the ground up for performance-critical applications

Zero Allocations

Achieved through intelligent event pooling and buffer reuse. No garbage collection pressure in hot paths.

🚀

Ultra-Fast

63ns/op for simple logs, 62ns for Float64, 60ns for new field types. 64% faster than Zerolog, 67% faster than Zap.

🏗️

Structured Logging

Rich, type-safe field support with JSON output. Perfect for modern observability stacks.

🔍

OpenTelemetry Ready

Automatic trace and span ID injection for distributed tracing and correlation.

🎨

Multiple Outputs

JSON for production, colorized console for development. Extensible handler system.

🛡️

Type Safe

Strongly typed field methods prevent runtime errors. Compile-time safety for production confidence.

Performance Benchmarks

Live benchmark data updated automatically from CI/CD

Library Operation ns/op Allocations Performance Advantage
Bolt v2.0.0 Simple Log 63 0 64% faster than Zerolog
Zerolog Disabled 99.3 0 -
Zerolog Enabled 175.4 0 -
Zap Enabled 189.7 1 -
Logrus Enabled 2,847 23 -

Performance Trends Over Time

Get Started in Seconds

Zero configuration required. Start logging with maximum performance immediately.

Installation

go get github.com/felixgeelhaar/bolt

Basic Usage

package main

import (
    "os"
    "github.com/felixgeelhaar/bolt"
)

func main() {
    logger := bolt.New(bolt.NewJSONHandler(os.Stdout))

    logger.Info().
        Str("service", "api").
        Int("port", 8080).
        Msg("Server starting")
}

Advanced Features

// Context-aware logging with OpenTelemetry
contextLogger := logger.Ctx(ctx)

// Structured logging with rich types
logger.Info().
    Str("user_id", "12345").
    Bool("authenticated", true).
    Float64("processing_time", 0.234).
    Time("timestamp", time.Now()).
    Any("metadata", map[string]interface{}{
        "region": "us-east-1",
    }).
    Msg("Request processed")

Documentation & Resources

Everything you need to master high-performance logging