Logy|Docs

What is Logy?

A configurable logger with named loggers, handlers, context fields, and JSON output.

Logy is a configurable logging library for Go applications. It keeps logging calls small while letting the application decide how records are named, filtered, formatted, and written.

Use it when you want readable local logs, structured production logs, contextual request metadata, and configurable output without building a custom logging layer for every project.

Named loggers

Loggers are named. A logger can be created from the calling package, by an explicit name, or for a type.

main.go
packageLog := logy.Get()
namedLog := logy.Named("worker")
clientLog := logy.Of[http.Client]()

Named loggers make it possible to configure output by package or component.

Handlers

Handlers decide where log records go. Logy includes console, file, and syslog handlers, and it lets you register custom handlers.

Handlers can be selected from configuration, so the same application code can write to stdout locally and structured output in production.

Contextual fields

Context fields attach request-specific values to log records without passing a long list of arguments through every call.

main.go
ctx := logy.WithValue(context.Background(), "traceId", "trace-123")
log.I(ctx, "request completed")

Structured output

JSON output is useful when logs are consumed by external systems. Pattern output is useful when developers read logs directly in a terminal.

Logy lets the application choose the output shape through configuration while keeping call sites simple.

Where it fits

Logy is useful for services, CLIs, workers, and libraries that need consistent runtime logs. It does not force a framework model around your application; it focuses on logging concerns: names, levels, fields, handlers, formatting, and errors.