Log
Structured logging package for Go.
Install / Use
/learn @apex/LogREADME

Package log implements a simple structured logging API inspired by Logrus, designed with centralization in mind. Read more on Medium.
Handlers
- apexlogs – handler for Apex Logs
- cli – human-friendly CLI output
- discard – discards all logs
- es – Elasticsearch handler
- graylog – Graylog handler
- json – JSON output handler
- kinesis – AWS Kinesis handler
- level – level filter handler
- logfmt – logfmt plain-text formatter
- memory – in-memory handler for tests
- multi – fan-out to multiple handlers
- papertrail – Papertrail handler
- text – human-friendly colored output
- delta – outputs the delta between log calls and spinner
Example
Example using the Apex Logs handler.
package main
import (
"errors"
"time"
"github.com/apex/log"
)
func main() {
ctx := log.WithFields(log.Fields{
"file": "something.png",
"type": "image/png",
"user": "tobi",
})
for range time.Tick(time.Millisecond * 200) {
ctx.Info("upload")
ctx.Info("upload complete")
ctx.Warn("upload retry")
ctx.WithError(errors.New("unauthorized")).Error("upload failed")
ctx.Errorf("failed to upload %s", "img.png")
}
}
<a href="https://apex.sh"><img src="http://tjholowaychuk.com:6000/svg/sponsor"></a>
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
345.9kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
