wayneashleyberry / logfmt

An opinionated log formatter that you probably don't want to use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An opinionated log formatter that you probably don't want to use.

  • logfmt reads from stdin and prints formatted logs
  • logfmt expects structured json with certain keys
  • logfmt formats output to be similar to Google Cloud Platform Logging

Installation

You will need to have your $PATH setup to your go installation.

# Add this to your terminal .rc file
export PATH="$HOME/go/bin:$PATH"
go get -u github.com/wayneashleyberry/logfmt

Usage

logfmt reads from stdin, so pipe the output from your service into logfmt:

go run myapp.go | logfmt

Example

cat testdata/test.json | go run main.go

screen shot 2018-05-27 at 12 27 47

About

An opinionated log formatter that you probably don't want to use.

License:MIT License


Languages

Language:Go 100.0%