LogDoc
Documentation > Log Collection > Go

Collecting logs from Go applications

The LogDoc Go SDK with minimal allocations and structured logging support. Compatible with zap, zerolog and the standard log package.

Terminal — Installation
$ go get github.com/logdoc/logdoc-go
main.go — Integration
package main

import (
    "github.com/logdoc/logdoc-go"
)

func main() {
    logger, _ := logdoc.New(
        "logdoc-server:12345",
    )
    defer logger.Close()

    logger.Info("Service started",
        logdoc.String("service", "api"),
        logdoc.Int("port", 8080),
    )
}

Highlights

Zero-allocation API for hot-path logging
Compatibility with zap and zerolog via adapters
Built-in connection pool with automatic reconnect