Skip to main content

Sync logs from a remote server

Use an SSH connector to mirror logs from a production host into Log Lens, fetching only new bytes each time.

1. Add the connector​

Settings to Connectors to Add connector, choose SSH, and provide the host, user, and log paths. Paths can be exact or use safe glob patterns for daily and rotated logs:

{
"host": "app.example.com",
"port": 22,
"user": "deploy",
"key_path": "/Users/me/.ssh/id_ed25519",
"paths": [
"/var/www/app/storage/logs/laravel-*.log",
"/var/www/app/storage/logs/laravel.log.[0-9]*"
]
}

Log Lens uses your key with host-key verification enforced; passwords are never stored. Assign the connector to a module to label everything it pulls.

2. Preview, then sync​

Click Sync to see the exact files and how many bytes will be fetched, then confirm. Log Lens fetches only appended data, preserves rotated generations, and won't act on a file set that changed after the preview. The dashboard starts a background worker and shows live files, bytes, events, and the current filename; closing or reloading the page does not stop the run.

3. Automate it​

Run the sync on a schedule:

# Standalone (cron)
php bin/sync.php

# Laravel (schedule in the console kernel)
php artisan log-lens:sync

See Automate log syncing for scheduling details.

Next​