Beginner guide
By the end of this guide you will have watched two growing log files in one LogLens window, narrowed the view to the lines you care about, paused to search, and grouped the errors.
What you need
- LogLens installed from source, with its virtual environment active. See Install.
- A terminal in the cloned
loglensfolder. The guide uses the sample log script,scripts/genlog.py, that ships in that folder.
You do not need any real logs. The script writes made-up but realistic log lines, including errors with Python tracebacks.
Start two sample logs
Start a sample application log that grows by 10 lines a second, in the background:
bashpython3 scripts/genlog.py app.log --format generic --rate 10 &The
&at the end runs the script in the background, so you get your prompt back. The script writes toapp.loguntil you stop it.Start a sample web server log that grows by 5 lines a second:
bashpython3 scripts/genlog.py api.log --format nginx --rate 5 &This file uses the nginx access log format: one line per web request, with an HTTP status code.
WARNING
genlog.py empties the file you name before it starts writing. Only give it a new file name, never the name of a log you want to keep.
Open LogLens
Point LogLens at both files:
bashloglens app.log api.logThe window fills with the last 50 lines of each file, then new lines keep arriving at the bottom.
Read the top line. It is the status bar. It shows the version, one coloured label per file, and
lines:followed by the number of lines read so far.Read a log line. Each one starts with the file's label in square brackets, in that file's colour, then the time, then the original line:
text[app.log] 14:22:02 2026-11-09 14:22:02,118 ERROR app.core: unhandled exception in request handlerError lines are red, warnings yellow and debug lines dim. Traceback lines under an error are dim too.
Look at the bottom line. It is the footer, listing the main keys: Quit, Filter, Search, Errors, Pause, Histogram, Clusters and Export.
The project README shows the kind of screen you get (this example uses different files):
LogLens v0.2.0 [app.log ] [api.log ] lines: 8421
[app.log ] 14:22:01 INFO request completed in 42ms
[api.log ] 14:22:01 WARN retrying after backoff of 2s
[app.log ] 14:22:02 ERROR unhandled exception in request handler
[app.log ] 14:22:02 Traceback (most recent call last):
[app.log ] 14:22:02 File "app/core/handler.py", line 88, in process_request
[app.log ] 14:22:02 ValueError: invalid item state
[api.log ] 14:22:03 INFO cache miss for key user:4821
errors/min · 15m · peak 4 ▁▂▃▅█▃▂▁▁▂▃▄▂▁▁Narrow the view
Press /. A box opens at the bottom: regex filter — Enter keeps, Esc clears.
Type
POST. As you type, the view shrinks to the lines that containPOST. The status bar shows/POST/.Press Enter. The box closes and the filter stays on.
Press Esc. The filter is cleared and every line comes back.
Press e. Now only errors are shown, each with its traceback underneath. The status bar shows
ERRORS. Press e again to see everything.
In the nginx file, LogLens counts a 5xx status as an error and a 4xx status as a warning, so a 500 request shows up under Errors and a 404 does not.
Pause and search
Press p. The status bar shows
PAUSED. New lines are still collected, but the view stops moving.Scroll with ↑, ↓, PgUp and PgDn.
Press s, type
timeoutand press Enter. LogLens jumps to the newest line that containstimeoutand highlights every match in yellow. The status bar shows the match number, for example?timeout? match 12/12.Press n to go to the next older match, and N (Shift + n) to go back to a newer one.
Press p to resume. The search is cleared and the view jumps back to the newest lines.
Find the most common errors
Press t. A small chart appears with the label
errors/min · 15m · peakand a number: one bar per minute for the last 15 minutes. Press t again to hide it.Press c. The error clusters panel opens. Each row is a group of similar errors, with a count such as
[×14], a title, how many files it came from and when it was last seen. The biggest group is at the top.Use ↑ and ↓ to pick a row and press Enter. The panel closes, LogLens pauses, and the view jumps to the newest error in that group.
Save what you found
Press e to show errors only.
Press w. The export box opens with a file name already filled in, such as
loglens-export-20261109-142530.log.Press Enter. A message says how many lines were written and where. The file holds the original lines, without the coloured labels.
Finish
Press q to quit LogLens.
Stop the two sample scripts:
bashkill %1 %2Delete the sample files if you like:
rm app.log api.log.
What you learned
loglenstakes one or more file names and merges them into one live view.- / filters, e shows errors only, p pauses, s searches.
- t charts errors per minute, c groups similar errors, w saves the current view.
- Esc closes whatever is open, and clears the filter when nothing is.