Secure, compliant, and ultra-fast logging library built for enterprise applications. Zero allocations, advanced security features, and seamless migration tools for production environments that demand both performance and reliability.
Built from the ground up for performance-critical applications
Achieved through intelligent event pooling and buffer reuse. No garbage collection pressure in hot paths.
127ns/op for enabled logs, 85ns for disabled. 27% faster than Zerolog, 3x faster than Zap.
Rich, type-safe field support with JSON output. Perfect for modern observability stacks.
Automatic trace and span ID injection for distributed tracing and correlation.
JSON for production, colorized console for development. Extensible handler system.
Strongly typed field methods prevent runtime errors. Compile-time safety for production confidence.
Built-in security features and compliance standards for production environments
Automatic sanitization of log inputs prevents JSON injection attacks. All field values are properly escaped and validated.
Comprehensive input validation and sanitization at the field level. Prevents log forging and ensures data integrity.
Lock-free, thread-safe operations prevent race conditions. Safe for concurrent use across goroutines.
Meets enterprise compliance requirements for audit logging, data retention, and security monitoring.
Seamless migration tools and guides for switching from other logging libraries
package main
import (
"os"
"github.com/rs/zerolog"
)
func main() {
logger := zerolog.New(os.Stdout).With().Timestamp().Logger()
logger.Info().
Str("service", "api").
Int("port", 8080).
Msg("Server starting")
}
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")
}
package main
import (
"go.uber.org/zap"
)
func main() {
logger, _ := zap.NewProduction()
defer logger.Sync()
logger.Info("Server starting",
zap.String("service", "api"),
zap.Int("port", 8080),
)
}
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")
}
package main
import (
"github.com/sirupsen/logrus"
)
func main() {
logger := logrus.New()
logger.SetFormatter(&logrus.JSONFormatter{})
logger.WithFields(logrus.Fields{
"service": "api",
"port": 8080,
}).Info("Server starting")
}
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")
}
package main
import (
"log"
"os"
)
func main() {
logger := log.New(os.Stdout, "", log.LstdFlags)
logger.Printf("Server starting: service=%s port=%d",
"api", 8080)
}
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")
}
Production-ready capabilities for mission-critical applications
Fault-tolerant design with graceful degradation. Continues logging even when downstream systems fail.
Deep integration with monitoring systems and observability platforms for complete system visibility.
Meet regulatory requirements with comprehensive audit trails and compliance reporting.
Proven performance at enterprise scale with millions of log events per second.
Live benchmark data updated automatically from CI/CD
Library | Operation | ns/op | Allocations | Performance Advantage |
---|---|---|---|---|
Bolt | Disabled | 113.9 | 113.9 | 35% faster than Zerolog |
Bolt | Enabled | 113.9 | 113.9 | 35% faster than Zerolog |
Zerolog | Disabled | 99.3 | 0 | - |
Zerolog | Enabled | 175.4 | 0 | 79% slower than Bolt |
Zap | Enabled | 189.7 | 1 | - |
Logrus | Enabled | 2,847 | 23 | - |
Loading latest benchmark data...
Zero configuration required. Start logging with maximum performance immediately.
go get github.com/felixgeelhaar/bolt
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")
}
// 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")
Try Bolt logging features in your browser with live examples
Everything you need to master high-performance logging