Skip to main content
Install go_logs using Go modules with the go get command.

Install the package

Run the following command in your project directory:
go get github.com/drossan/go_logs@v3
This installs the latest v3 version of go_logs with all modern features.

Verify installation

Verify the installation by checking your go.mod file:
go.mod
module your-project

go 1.21

require (
    github.com/drossan/go_logs v3.5.0
)

Dependencies

go_logs has minimal dependencies:
  • github.com/fatih/color - ANSI color support for terminal output
  • github.com/slack-go/slack - Slack notifications (optional)
These are automatically installed when you run go get.

Go version

go_logs requires Go 1.21 or later. Check your Go version:
go version
If you need to upgrade Go, visit https://go.dev/dl/.

Update to latest version

Update to the latest version of go_logs:
go get -u github.com/drossan/go_logs
Or update all dependencies:
go get -u ./...
go mod tidy

Optional modules

go_logs uses a hybrid architecture with optional modules for advanced features:

Async logging

For non-blocking logging with buffered channels:
go get github.com/drossan/go_logs/async

HTTP endpoints

For dynamic log level control via HTTP:
go get github.com/drossan/go_logs/http

Signal handlers

For SIGHUP-based log rotation:
go get github.com/drossan/go_logs/signal

OpenTelemetry

For sending logs to OTLP collectors:
go get github.com/drossan/go_logs/otel

Hooks

For Slack, syslog, and other integrations:
go get github.com/drossan/go_logs/hooks
The core package includes all essential features. Optional modules are only needed for specific use cases.

Next steps

Quick start

Learn the basics with a working example

Configuration

Configure go_logs for your environment

Build docs developers (and LLMs) love