S
Sprint Log Parser
Docs / Log Ingestion / Laravel Exceptions

Laravel Exception Logger

Monitor system health, catch database driver exceptions, and track unhandled runtime failures thrown by your PHP applications.

1. Auto Installer Setup

The simplest way to stream Laravel logs is using the interactive cURL installer. It automatically handles the shipper installation, configuration generation, and service daemon setup:

curl -sS https://sprint-logparser.dev.5starcompany.com.ng/download/setup | sudo SERVER_URL="https://sprint-logparser.dev.5starcompany.com.ng" API_TOKEN="YOUR_API_TOKEN" bash

By running the command directly copied from your project dashboard, the installation script will automatically inherit your project token. It will only prompt you for the following log-specific details:

  • Instance Name: Enter `laravel` (or any custom identifier to isolate this daemon).
  • Log File Path to monitor: `/var/www/html/storage/logs/laravel-%Y-%m-%d.log` (or your static `laravel.log` path).
  • Log Type: Select **3** (Laravel Application Log).

2. Daily Channel Configuration

Sprint Log Parser supports standard Laravel logs formatting. To isolate logs per day and prevent filesystem saturation, use the `daily` driver channel in your `config/logging.php` file:

'daily' => [
    'driver' => 'daily',
    'path' => storage_path('logs/laravel.log'),
    'level' => env('LOG_LEVEL', 'debug'),
    'days' => 14,
    'replace_placeholders' => true,
],

Set the default logger channel in your workspace environmental variables (`.env`):

LOG_CHANNEL=daily

3. Exception Stacktrace Formatting

The log analyzer utilizes multi-line regex rules to automatically merge PHP stacktraces into a single visual telemetry block. Ensure your logs do not truncate traceback messages by keeping defaults in `config/logging.php`.


4. Manual Shipper Configuration (Optional)

Alternatively, you can manually update the configuration file at `/etc/log-shipper.json` based on your active logging settings:

Option A: Single Channel Ingestion

For environments using the static `single` log file:

{
  "api_url": "https://sprint-logparser.dev.5starcompany.com.ng/api/projects/ingest",
  "api_token": "YOUR_WORKSPACE_INGESTION_TOKEN",
  "log_file": "/var/www/html/storage/logs/laravel.log",
  "log_type": "laravel"
}

Option B: Daily Rotated Channel Ingestion

For the recommended `daily` channel, define a date-interpolated path structure (using `%Y-%m-%d` formatting tokens) so the daemon targets the active day's log file automatically:

{
  "api_url": "https://sprint-logparser.dev.5starcompany.com.ng/api/projects/ingest",
  "api_token": "YOUR_WORKSPACE_INGESTION_TOKEN",
  "log_file": "/var/www/html/storage/logs/laravel-%Y-%m-%d.log",
  "log_type": "laravel"
}