Logs final readonly class
Minn\Ops\Logs · public/minn/src/Minn/Ops/Logs.php · 150 lines
The log files the System view can read and clear: the debug log the engine's failure handler writes, and PHP's own error log when it is a separate file inside the site. Anything outside the site is named but never read; it may be another tenant's.
Uses 1
Constants and properties
| private | TAIL_BYTES = 262144 | |
| private | readonly string $webroot | Promoted from the constructor. |
Public
| new | __construct(string $webroot)# | |
| method | sources(): array# | Every log the engine knows about, with its path and group. @return array<string, array{label: string, group: string, path: string}> |
| method | listPayload(): array# | The logs list as the System view shows it. @return list<array> the sources that exist, debug first |
| method | read(string $id): array# | One log's tail, by id. |
| method | clear(string $id): void# | Empties one log. |
| method | debugLogPath(): string# | Where debug.log lives, from WP_DEBUG_LOG or the default. |
| method | tail(string $path): array# | The last TAIL_BYTES of a file, the partial first line dropped. |
| method | owned(string $path): bool# | True when the path resolves inside the webroot. |
| static | human(int $bytes): string# | A byte count in KB, MB, or GB. |
Nothing matches.