Lnav is more than a log viewer. It’s a live, interactive shell for your logs that lets you query, filter, and search across multiple files. But its full power often hides behind the right environment variables. Miss one, and you miss the depth of what it can do.
Environment variables in Lnav control behavior before the first log loads. They set directories, tweak performance, and define formats. The difference between a default setup and a tuned one is speed, clarity, and less time sifting through noise.
One critical example:LNAV_CONFIG_DIR sets the directory for your personal configuration and history. Move it to a shared network location and your team instantly gets consistent filters, formats, and queries. This single change can turn scattered work into a unified log strategy.
For better resource handling, LNAV_LOG_LEVEL tunes verbosity so you only see debugging output when you need it. In automated workflows, setting LNAVSECURE_MODE to 1 locks down risky features while still letting you run powerful queries. Teams that work with sensitive data should treat this as non‑optional.