Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wayneashleyberry/logfmt
An opinionated log formatter that you probably don't want to use.
https://github.com/wayneashleyberry/logfmt
cli command-line fmt formatter gcp go golang google-cloud log
Last synced: 29 days ago
JSON representation
An opinionated log formatter that you probably don't want to use.
- Host: GitHub
- URL: https://github.com/wayneashleyberry/logfmt
- Owner: wayneashleyberry
- License: mit
- Created: 2019-10-08T10:47:01.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-07-13T12:58:00.000Z (over 4 years ago)
- Last Synced: 2024-08-03T23:27:13.608Z (4 months ago)
- Topics: cli, command-line, fmt, formatter, gcp, go, golang, google-cloud, log
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - logfmt
README
> 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"
``````sh
go get -u github.com/wayneashleyberry/logfmt
```### Usage
`logfmt` reads from stdin, so pipe the output from your service into `logfmt`:
```sh
go run myapp.go | logfmt
```### Example
```sh
cat testdata/test.json | go run main.go
```