• Stars
    star
    1,345
  • Rank 33,585 (Top 0.7 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Structured logging package for Go.

Structured logging for golang

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")
	}
}

Build Status GoDoc

More Repositories

1

up

Deploy infinitely scalable serverless apps, apis, and sites in seconds to AWS.
Go
8,762
star
2

gh-polls

Polls for user feedback in GitHub issues
Go
1,760
star
3

gateway

Drop-in replacement for Go net/http when running in AWS Lambda & API Gateway
Go
647
star
4

apex-ui

Apex monochrome Atom theme UI.
CSS
411
star
5

up-examples

Example apps, apis, and sites for Up.
HTML
389
star
6

apex-go

Golang runtime for Apex/Lambda.
Go
293
star
7

static

The static site anti-framework – general-purpose library, purpose-built commands for various domains
Go
292
star
8

node-apex

Node.js module that makes AWS Lambda's user experience a little nicer using promises.
JavaScript
279
star
9

rpc

Simple RPC style APIs with generated clients & servers.
Go
215
star
10

actions

GitHub Actions
Go
176
star
11

gui

GitHub readme UI components
CSS
132
star
12

apex-syntax

Apex monochrome Atom theme syntax.
CSS
128
star
13

apex-shell

Interactive shell for executing commands in AWS Lambda containers.
Go
121
star
14

capture

Lambda function to capture a URL as PNG, JPG, or GIF using PhantomJS
JavaScript
109
star
15

httpstat

Higher level HTTP tracing for Go
Go
96
star
16

js

Go packages for JavaScript WASM interoperability in the browser
Go
89
star
17

apex-ui-slim

Apex monochrome Atom theme UI (slim variant)
CSS
74
star
18

svg_to_png

Lambda function to convert SVG to PNG using PhantomJS
JavaScript
71
star
19

logs

Apex Logs client for Go.
Go
61
star
20

apex.run

Apex website
HTML
59
star
21

up.js

Up application companion library for Node and the browser
JavaScript
58
star
22

logs-cloudwatch

Send your AWS CloudWatch Logs to Apex Logs.
Go
39
star
23

logs-js

Apex Logs client for Node, Deno, and the browser
TypeScript
38
star
24

httplog

Go http logger for apex/log.
Go
35
star
25

parsers

Performant Go log format parsers.
Go
31
star
26

roadmap

Roadmap for Apex Software products
30
star
27

apex

Old apex/apex
Go
29
star
28

invoke

Lambda invocation helper functions for Go.
Go
27
star
29

logs-winston

Apex Logs integration for the Node.js Winston logging framework
JavaScript
23
star