log

log discovers or opens log files, reads a bounded head or tail and filters lines without loading a growing log into memory all at once.

DiagnosticsVersion 1.3.1Stable
lil-terminal

Overview

Use log for focused operational reading: find the relevant file, choose the first or last lines, then filter literal text when needed. The command never edits the log.

Reduce the log before reading it

Operational logs grow continuously and often contain far more data than one diagnosis needs. log keeps the task small: locate the file, take a bounded window and filter it. This is safer and faster on shared hosting than opening a large log in an editor.

Syntax

lil-terminal
log [<file>|<dir>] [-h] [-n <lines>] [-g <text>] [-i] [-l] [-r]

Reference

log

show the newest detected log

log <file>

read a selected log file

log <dir>

find a log inside a directory

log -l

list detected log files

log <dir> -l

list log files inside a directory

-h

read from the beginning

-n <lines>

show 1–50000 physical lines

-g <text>

filter lines containing literal text

-i

ignore case when used with -g

-r

show original lines without grouping

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Find logs and read a short tail

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install log
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install log -m
Exact public version

Install exactly this published version.

install log -v 1.3.1
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade log
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install log -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Find logs and read a short tail
log sandbox/logs/review.log
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log

[20-Oct-2026 08:00:00 UTC]
PHP Notice: request started in /sandbox/src/start.php on line 12

[20-Oct-2026 08:00:01 UTC]
PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Stack trace:
#0 /sandbox/src/index.php(20): loadSettings()

[20-Oct-2026 08:00:02 UTC]
PHP Debug: using fallback configuration

[20-Oct-2026 08:00:03 UTC]
PHP Fatal error: unable to initialize test connection in /sandbox/src/db.php on line 41
Stack trace:
#0 /sandbox/src/index.php(31): connect()
Read from the beginning
log sandbox/logs/review.log -h
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log

[20-Oct-2026 08:00:00 UTC]
PHP Notice: request started in /sandbox/src/start.php on line 12

[20-Oct-2026 08:00:01 UTC]
PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Stack trace:
#0 /sandbox/src/index.php(20): loadSettings()

[20-Oct-2026 08:00:02 UTC]
PHP Debug: using fallback configuration

[20-Oct-2026 08:00:03 UTC]
PHP Fatal error: unable to initialize test connection in /sandbox/src/db.php on line 41
Stack trace:
#0 /sandbox/src/index.php(31): connect()
Read a selected log file
log sandbox/logs/review.log -t
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log

[20-Oct-2026 08:00:00 UTC]
PHP Notice: request started in /sandbox/src/start.php on line 12

[20-Oct-2026 08:00:01 UTC]
PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Stack trace:
#0 /sandbox/src/index.php(20): loadSettings()

[20-Oct-2026 08:00:02 UTC]
PHP Debug: using fallback configuration

[20-Oct-2026 08:00:03 UTC]
PHP Fatal error: unable to initialize test connection in /sandbox/src/db.php on line 41
Stack trace:
#0 /sandbox/src/index.php(31): connect()
Show 1–50000 physical lines
log sandbox/logs/review.log -n 2
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log

Stack trace:
#0 /sandbox/src/index.php(31): connect()
Show 1–50000 physical lines
log sandbox/logs/review.log -h -n 2
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log

[20-Oct-2026 08:00:00 UTC]
PHP Notice: request started in /sandbox/src/start.php on line 12

[20-Oct-2026 08:00:01 UTC]
PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Filter lines containing literal text
log sandbox/logs/review.log -g Warning
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log
Filter: Warning

[20-Oct-2026 08:00:01 UTC]
PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Ignore case when used with -g
log sandbox/logs/review.log -g warning -i
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log
Filter: warning

[20-Oct-2026 08:00:01 UTC]
PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Handle a missing log file
log sandbox/logs/review.log -g DEBUG
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log
Filter: DEBUG

[no matching lines]
Show original lines without grouping
log sandbox/logs/review.log -g error -i -r
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log
Filter: error

[20-Oct-2026 08:00:03 UTC] PHP Fatal error: unable to initialize test connection in /sandbox/src/db.php on line 41
Show original lines without grouping
log sandbox/logs/review.log -r
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log

[20-Oct-2026 08:00:00 UTC] PHP Notice: request started in /sandbox/src/start.php on line 12
[20-Oct-2026 08:00:01 UTC] PHP Warning: missing configuration in /sandbox/src/config.php on line 18
Stack trace:
#0 /sandbox/src/index.php(20): loadSettings()
[20-Oct-2026 08:00:02 UTC] PHP Debug: using fallback configuration
[20-Oct-2026 08:00:03 UTC] PHP Fatal error: unable to initialize test connection in /sandbox/src/db.php on line 41
Stack trace:
#0 /sandbox/src/index.php(31): connect()
List detected log files
log -l
Training example — PHP environment, server and repository responses are simulated
2026-11-01 12:00:00	96 B	sandbox/logs/app.log
2026-11-01 12:00:00	219 B	sandbox/logs/errors.log
2026-10-20 08:00:00	487 B	sandbox/logs/review.log
List log files inside a directory
log sandbox -l
Training example — PHP environment, server and repository responses are simulated
2026-11-01 12:00:00	96 B	sandbox/logs/app.log
2026-11-01 12:00:00	219 B	sandbox/logs/errors.log
2026-10-20 08:00:00	487 B	sandbox/logs/review.log
Find a log inside a directory
log sandbox
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/app.log

2026-01-01T00:00:00Z INFO sandbox initialized

2026-01-01T00:00:01Z DEBUG sample event completed
Filter lines containing literal text
log sandbox/logs/review.log -g no-such-event
Training example — PHP environment, server and repository responses are simulated
File: sandbox/logs/review.log
Filter: no-such-event

[no matching lines]
Read a selected log file
log sandbox/logs/missing.log
Training example — PHP environment, server and repository responses are simulated
Log file not found
Show 1–50000 physical lines
log sandbox/logs/review.log -n 0
Training example — PHP environment, server and repository responses are simulated
Line count must be between 1 and 50000
Show 1–50000 physical lines
log sandbox/logs/review.log -n 50001
Training example — PHP environment, server and repository responses are simulated
Line count must be between 1 and 50000
Show 1–50000 physical lines
log sandbox/logs/review.log -n abc
Training example — PHP environment, server and repository responses are simulated
Invalid line count
Ignore case when used with -g
log sandbox/logs/review.log -i
Training example — PHP environment, server and repository responses are simulated
Option -i requires -g <text>
Filter lines containing literal text
log sandbox/logs/review.log -g
Training example — PHP environment, server and repository responses are simulated
Search text is required
Read a selected log file
log sandbox/logs/review.log -z
Training example — PHP environment, server and repository responses are simulated
Unknown option: -z
Read a selected log file
log sandbox/logs/review.log -l
Training example — PHP environment, server and repository responses are simulated
List mode accepts a directory, not a file
Filter lines containing literal text
log sandbox -l -g error
Training example — PHP environment, server and repository responses are simulated
List mode does not accept a search filter
Read a selected log file
log sandbox/logs/review.log sandbox/logs/review.log
Training example — PHP environment, server and repository responses are simulated
Too many paths

File used in this example: sandbox/logs/app.log

The example uses a file or directory from the protected /sandbox/ documentation workspace.

2026-01-01T00:00:00Z INFO sandbox initialized
2026-01-01T00:00:01Z DEBUG sample event completed

Related documentation

Current public release

v1.3.12026-10-31

Production refinement

Current stable release of log. log discovers or opens log files, reads a bounded head or tail and filters lines without loading a growing log into memory all at once.