Skip to main content

Laravel Log Monitoring with LogMonitor

>_ why laravel apps need log monitoring

Laravel applications generate logs across HTTP requests, queued jobs, scheduled tasks, and artisan commands. The default log files grow large and are difficult to search, especially on multi-server deployments. LogMonitor gives you a centralized Live Console that streams logs from every Laravel process in real time with structured filtering.

>_ how logmonitor works with laravel

Create a custom Laravel log channel that sends logs to the LogMonitor HTTP API. Add the channel to your logging.php config and use it alongside or instead of the default stack. The API returns 202 Accepted on success. All Log::info(), Log::error(), and exception handler logs are automatically forwarded to your LogMonitor dashboard.

>_ quick start

app/Logging/LogMonitorHandler.php · php
<?php
namespace App\Logging;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\LogRecord;
use Illuminate\Support\Facades\Http;
class LogMonitorHandler extends AbstractProcessingHandler
{
    protected function write(LogRecord $record): void
    {
        Http::withHeaders([
                'X-Logmonitor-Api-Key' => config('services.logmonitor.api_key'),
                'Content-Type' => 'application/json',
            ])
            ->post('https://api.logmonitor.io/v1/logs', [
                [
                    'level'           => strtolower($record->level->name),
                    'message'         => $record->message,
                    'clientTimestamp'  => time(),
                ],
            ]);
        // Returns 202 Accepted on success
    }
}
// In config/logging.php channels array:
// 'logmonitor' => ['driver' => 'monolog', 'handler' => App\Logging\LogMonitorHandler::class]
// Usage: Log::channel('logmonitor')->error('Payment failed', ['order_id' => 456]);

>_ what you can monitor

  • $HTTP request errors and exception traces
  • $Queued job failures and retries
  • $Scheduled task (cron) execution logs
  • $Database query errors and slow queries
  • $Authentication and authorization failures
  • $Third-party API integration errors

>_ frequently asked questions

$ Can I use LogMonitor as the default Laravel log channel?

Yes. Set LOG_CHANNEL=logmonitor in your .env file or add 'logmonitor' to your stack channel. All Log:: calls and exception reports will be forwarded to LogMonitor automatically.

$ Does LogMonitor capture Laravel exception reports?

Yes. Laravel's exception handler uses the configured log channel to report errors. If LogMonitor is your active channel, all unhandled exceptions are sent to your Live Console with full stack traces.

$ Can I monitor Laravel queued jobs?

Yes. Queued job workers use the same logging configuration. Any Log:: calls inside your job classes and any job failure exceptions are sent to LogMonitor through the custom channel.

$ Does the HTTP call slow down my Laravel requests?

The HTTP call is fast, but for zero overhead you can dispatch the log sending to a queue or use Laravel's async HTTP client. This ensures the API call never blocks your request lifecycle.

$ Does LogMonitor work with Laravel Vapor and Forge?

Yes. LogMonitor is infrastructure-agnostic. Whether you deploy on Vapor (serverless), Forge, Envoyer, or a custom server, the custom log channel works the same way as long as the app can reach the LogMonitor API.

>_ related pages

>_ about logmonitor

LogMonitor.io is a log observability platform built for developers who want simple, fast, affordable log monitoring without enterprise complexity. Stream production logs from your users' devices in real-time with native Flutter and React SDKs. Set up in under 5 minutes, with plans starting at $9/month. No dashboards to configure, no query languages to learn — just your logs, live.

logmonitor --start
Ready to see your production logs in real-time?
Start Monitoring →

Plans from $9/mo · Set up in under 5 minutes