JL(1)
π JL(1) β the manual, but make it cute π
okay bestie, sit down, hydrate, and let me tell you about jl, a little icon from the JL(1) manual. she's a command-line girlie and she is so good at her job. π«Ά
β¨ NAME β¨
jl β pretty-print JSON logs π
πΈ SYNOPSIS πΈ
jl [options...] [file]
π¦ DESCRIPTION π¦
so like. jl is a parser and formatter for JSON logs, and her whole entire purpose is making machine-readable JSON logs human readable again. which is honestly iconic of her. β¨
she consumes JSON logs from stdin and writes human-readable logs to stdout. that's the whole vibe. to use her, you literally just pipe your JSON logs through her:
./my-app-executable | jl
cat app-log.json | jl
and yes, she can also read from a file, she's flexible like that:
jl my-app-log.json
π«Ά quick honesty moment:jlherself does not support following log files. no cap. but because she can consume from a pipe, you can just hand that job totail:
tail -F app-log.json | jl
and if you wanna page through her colorised output, you can use less with the -R flag:
jl my-app-log.json | less -R
π OPTIONS π
here's the summary of options, bestie. she doesn't have many but she uses every single one.
-colorauto|yes|no β set the color mode. the options are"auto","yes", and"no"."auto"disables color if stdout is not a TTY (default:"auto")-formatcompact|logfmt β the formatter for logs. the options are"compact"and"logfmt"(default:"compact")-truncate[=false]β whether to truncate strings in the compact formatter (default:true)
π FORMATTERS π
jl currently supports two formatters, with plans to make the formatters customizable. so like, watch this space ig π
the default is -format compact, which extracts only important fields from the JSON log β like message, timestamp, level β colorises them and presents them in an easy to skim way. it drops unrecognised fields from the logs. gone. not invited. πͺ
the other option is -format logfmt, which formats the JSON logs in a way that closely resembles logfmt. this option emits all fields from each log line. no field left behind, fr fr.
and here's the sweet part: both formatters echo non-JSON log lines as-is. π«Ά
π LOG FORMATS π
JSON application logs tend to have some core shared fields β like level, timestamp, and message β which jl tries to discover and prioritise for formatting. for now, the following formats work best with jl. for string fields other than level, only the keys matter. β¨
other formats can be used after preprocessing with jq. (iykyk)
- Java-like:
{
"level": "error",
"timestamp": "2019-02-02 15:39:45",
"logger": "HelloWorldService",
"thread": "main",
"message": "hello world",
"exception": "java.lang.IllegalArgumentException: The world isn't here\n...stacktraces..."
}
- Go/Logrus-like:
{
"level": "error",
"timestamp": "2019-02-02 15:39:45",
"msg": "hello world",
"error": "hello error",
"stack": "\nhello\n\thello.go\nworld\n\tworld.go"
}
π COPYRIGHT π
Copyright (C) 2019-2023 Yunchi Luo
License: MIT/Expat
this manual page is based on the README document by the author. it was reformatted and adapted by Andrej Shadura <andrewsh@debian.org> for the Debian project, and is distributed under the same license as the original project. slay. π«Ά
β SEE ALSO β
π and that's the whole page bestie!! this was the JL(1) manual, and the version/date on the tin is 2023-08-24. go forth and make your logs cute. periodt. πβ¨π¦πΈπ
π¦ where this page comes from
- ubuntu noble: jl 0.1.0+git20220705+8771236337c6-1build1 Β· MIT
- ubuntu questing: jl 0.1.0+git20220705+8771236337c6-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms