Skip to main content

CLI and Artisan commands

Log Lens ships two command-line entry points for ingesting logs outside the dashboard: import (index files you point at directly) and sync (pull from configured connectors). The standalone app exposes them as PHP scripts; the Laravel adapter registers them as Artisan commands. Both write their result as pretty-printed JSON to stdout.

Import

Index one or more log files or directories in place. Paths are streamed where they sit - files are never moved or copied.

# Standalone
php bin/import.php path/to/app.log storage/logs --app=default

# Laravel
php artisan log-lens:import path/to/app.log storage/logs --app=default
Argument / optionRequiredMeaning
paths (one or more)yesLog files or directories to import
--app=<id>noTarget application; resolves the default when omitted

The standalone script exits 1 if no paths are given. The Artisan command returns success when the result carries no errors, and failure otherwise.

Sync

Run the local-directory and SSH connectors for an application, discovering and ingesting new log content.

# Standalone
php bin/sync.php --app=default # all connectors
php bin/sync.php --app=default --connector=2 # one connector

# Laravel
php artisan log-lens:sync --app=default
php artisan log-lens:sync --app=default --connector=2
OptionMeaning
--app=<id>Target application; resolves the default when omitted
--connector=<id>Sync only this connector id; omit to sync all

With no (or a non-positive) --connector, every connector for the application is synced. An invocation that finds durable dashboard-queued runs services that queue; the ordinary scheduled pass runs when no queued work exists. The standalone script exits 0 on success and 2 when the result contains errors (1 on an unknown argument or thrown exception); -h / --help prints usage. The Artisan command returns failure when the result reports errors.

Scheduling

Schedule log-lens:sync in your app's console kernel for continuous connector ingestion, for example hourly per application. Import is best run on demand for one-off files.