Skip to content

dominionthedev/logfmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logfmt logo

logfmt 🪵

Build Status Go Version License

Pipe logs and get formatted, colorized, filterable terminal output.
Supports JSON and logfmt (key=value) style logs. Falls back gracefully for plain text.

demo

Install

go install github.com/dominionthedev/logfmt@latest

Or download a prebuilt binary from the releases page

  • With Eget:
eget dominionthedev/logfmt

Usage

Note

Some Flags doesn't work, and some logs don't get formatted This will be fixed in the next

# Basic — pipe anything in
tail -f app.log | logfmt

# Filter to warn and above
cat app.log | logfmt --level warn

# Only show lines matching a string
kubectl logs my-pod | logfmt --filter "user_id=42"

# Hide KV pairs, show time + level + message only
cat app.log | logfmt --time-only

# Combine
tail -f app.log | logfmt --level error --filter "database"

Flags

Flag Short Description
--filter -f Only show lines containing this string (case-insensitive)
--level -l Minimum level: debug, info, warn, error, fatal
--time-only -t Hide KV pairs, show time + level + message only
--no-color Disable color output

Supported formats

  • JSON — detects { prefix, reads common keys (level, msg, time, etc.)
  • logfmt — parses key=value and key="quoted value" pairs
  • Plain text — rendered as-is in muted style

Level colors

Level Color
DEBUG Blue
INFO Green
WARN Amber
ERROR Red
FATAL Red + underline

About

A simple tool to format and colourize Logs 🪵🌈

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages