Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:explogs

The log viewer on the command line: list the log files, follow one, search them and their rotations, find an error reference and the lines of its request (masked by default); rotate logs and prune their archives (dry…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/commands/explogs.md

On this page

exp:explogs

The log viewer on the command line: list the log files, follow one, search them and their rotations, find an error reference and the lines of its request (masked by default); rotate logs and prune their archives (dry run unless --apply).

Script bin/php/explogs.php, code in kernel/private/classes/commands/explogs.php. Run it from the installation root, as the user the web server runs as:

./console exp:explogs --help
./console exp:logs --help
php bin/php/explogs.php --help

Help text

The log viewer on the command line (read only; e-mail and IP addresses and secrets masked unless --unmask)

./console exp:logs --list                                  the log files: group, size, time, lines a minute
./console exp:logs --tail=var/log/error.log --lines=50     the last 50 entries
./console exp:logs --tail=var/log/error.log --follow       follow it (Ctrl-C ends)
./console exp:logs --search=timeout --file=var/log/error.log --rotations --level=error,warning
./console exp:logs --search='/content/view/\d+' --regex --scope=kernel --from='2026-10-17 01:00' --to='2026-10-17 02:00'
./console exp:logs --reference=ERR-0123456789          where an error page's reference is, and its request
./console exp:logs --related=var/log/error.log:123456      the lines of the request of the entry at that offset

Log management (doc/eng-us/features/6.0/log-rotation.md):
./console exp:logs --archives                              each log with its archives and their sizes
./console exp:logs --rotate=error,debug --apply            rotate these logs now (keys as in --archives, or ids)
./console exp:logs --rotate-all --apply                    rotate every log that is not empty
./console exp:logs --prune                                 the archives beyond site.ini [FileSettings] limits
./console exp:logs --prune=error --apply                   remove them (all logs, or these)
./console exp:logs --compress --apply                      compress the archives from .2 on
./console exp:logs --truncate=debug [--in-place] --apply   empty a log (rotated, or in place)
--rotate, --rotate-all, --prune, --compress and --truncate change files only with --apply; without it
they print the plan. --dry-run means the same as no --apply; --apply together with --dry-run is a usage
error (exit 2).

Exit code: 0 something listed or found, 1 nothing found, 2 error.

Options

OptionValueHelp
--listList the log files the viewer may open, by group, with size, time and lines a minute
--archivesList the logs that can be rotated, with their archives (.1 .. .N, .gz) and sizes, and the limits
--rotaterequiredRotate these logs now, whatever their size: keys (error,debug,site-storage) or ids (var/log/error.log), comma separated
--rotate-allRotate every log over its MaxSize (with --force: every log that is not empty)
--forceWith --rotate-all: also the logs under their MaxSize
--pruneoptionalRemove the archives beyond the limits (Keep, MaxAgeDays): of every log, or of these keys
--daysrequiredWith --prune: remove archives older than this many days instead of MaxAgeDays
--compressoptionalCompress the plain archives from .2 on: of every log, or of these keys
--truncaterequiredEmpty these logs: rotate them (the content stays in .1), or with --in-place empty the file itself
--in-placeWith --truncate: empty the file in place, keeping no copy
--applyWith --rotate, --rotate-all, --prune, --compress or --truncate: change the files (the default is a dry run that prints the plan)
--dry-runThe default, kept for scripts that pass it: only print the plan
--tailrequiredThe last entries of a file (its path relative to the root, e.g. var/log/error.log)
--linesrequiredWith --tail: how many entries (default 20)
--followWith --tail: go on printing what the file gains, polling with backoff (Ctrl-C ends)
--intervalrequiredWith --follow: the shortest poll interval in milliseconds (default [TailSettings] PollInterval)
--searchrequiredSearch for a text (literal, or a regular expression with --regex)
--regexWith --search: the text is a regular expression (bounded by [SearchSettings] BacktrackLimit and TimeLimit)
--caseWith --search: case sensitive
--filerequiredWith --search: the file (default: [LogViewerSettings] DefaultFile)
--scoperequiredWith --search: file (default), kernel (every kernel log) or all (every file listed)
--rotationsWith --search: the rotations (.1 .. .N, .gz) too
--levelrequiredOnly these levels: error,warning,notice,debug
--fromrequiredOnly entries at or after this time (e.g. 2026-10-17 01:00)
--torequiredOnly entries at or before this time (a date alone means the whole day)
--sarequiredOnly entries of this siteaccess
--urirequiredOnly entries whose request contains this text
--iprequiredOnly entries whose client address starts with this
--cursorrequiredWith --search: go on from where an earlier search stopped (printed as "More: --cursor=...")
--limitrequiredWith --search: print at most this many entries
--referencerequiredFind an error reference (ERR-XXXXXXXXXX) in the kernel logs and their rotations, with its request
--relatedrequiredThe lines of the same request as the entry at <file>:<offset>
--unmaskShow e-mail addresses, IP addresses and secrets unmasked (the values of secret settings stay hidden)
--jsonOne JSON object instead of the text
--colorrequiredColor the levels: auto (default: when the output is a terminal), always, never

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/explogs.php, kernel/private/classes/commands/explogs.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x