An opinionated log formatter that you probably don't want to use.
logfmt
reads from stdin and prints formatted logslogfmt
expects structured json with certain keyslogfmt
formats output to be similar to Google Cloud Platform Logging
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
logfmt
reads from stdin, so pipe the output from your service into logfmt
:
go run myapp.go | logfmt
cat testdata/test.json | go run main.go