Optimizing Lnav with the `user-config-dependent` Setting
The logs don’t lie, but they can waste your time if your tools aren’t tuned. Lnav loads faster, parses smarter, and gives you context only when your configuration is right. The user-config-dependent setting lets you control how views, formats, and filters adapt to your local setup without breaking shared workflows.
By default, Lnav pulls both system and user configurations. When user-config-dependent is enabled, it treats certain settings—like custom log formats, color themes, or SQL queries—as tied to your user profile. This eliminates guesswork when switching between shared environments, because your private overrides don’t bleed into team-wide defaults.
To use it, check your Lnav version supports the setting. In your ~/.lnav/config.json, set:
{
"ui": {
"user-config-dependent": true
}
}
Restart Lnav, then run :config to confirm it’s active. When enabled, search paths and priority rules change:
- User configs override system configs for dependent resources.
- Non-dependent configs remain global.
- Filters and highlights stored in your home directory no longer affect other users.
This is critical in CI/CD log pipelines, where consistent parsing rules are required but local tweaks help debug issues faster. Combined with lnav scripts, it allows dynamic, user-specific defaults without altering the centralized baseline.
Keep in mind: if you rely on shared regex patterns or themes, verify they remain in the system config to avoid silent mismatches. Use :config-dump to audit what is being applied in your session.
Efficient log analysis depends on clean separation of shared and personal configs. The user-config-dependent setting is a small switch with high impact on workflow stability.
See it live in minutes with a fully configured demo on hoop.dev and cut your log debugging time today.