LogTide integration for Laravel - automatic request tracing, error capture, and breadcrumbs.
- Automatic request tracing via HTTP middleware
- Error capture with full request context
- W3C Trace Context propagation (
traceparentin/out) - Laravel Log Channel - use LogTide as a logging driver
- Facade -
Logtide::info(...)static access - Breadcrumb integrations - DB queries, cache operations, queue jobs
- Auto-discovery - zero configuration needed
- Laravel 10, 11, and 12 support
composer require logtide/logtide-laravelThe service provider is auto-discovered. No manual registration needed.
- Add your DSN to
.env:
LOGTIDE_DSN=https://lp_your_key@your-logtide-instance.com- Optionally publish the config:
php artisan vendor:publish --tag=logtide-configThat's it! HTTP requests are automatically traced, exceptions captured, and DB queries recorded as breadcrumbs.
// config/logtide.php
return [
'dsn' => env('LOGTIDE_DSN'),
'service' => env('LOGTIDE_SERVICE', env('APP_NAME', 'laravel')),
'environment' => env('LOGTIDE_ENVIRONMENT', env('APP_ENV', 'production')),
'release' => env('LOGTIDE_RELEASE'),
'batch_size' => (int) env('LOGTIDE_BATCH_SIZE', 100),
'flush_interval' => (int) env('LOGTIDE_FLUSH_INTERVAL', 5000),
'max_buffer_size' => (int) env('LOGTIDE_MAX_BUFFER_SIZE', 10000),
'max_retries' => (int) env('LOGTIDE_MAX_RETRIES', 3),
'traces_sample_rate' => (float) env('LOGTIDE_TRACES_SAMPLE_RATE', 1.0),
'debug' => (bool) env('LOGTIDE_DEBUG', false),
'send_default_pii' => (bool) env('LOGTIDE_SEND_DEFAULT_PII', false),
'breadcrumbs' => [
'db_queries' => true,
'cache' => true,
'queue' => true,
'http_client' => true,
],
'skip_paths' => ['/health', '/healthz'],
];Add LogTide as a logging channel in config/logging.php:
'channels' => [
'logtide' => [
'driver' => 'custom',
'via' => \LogTide\Laravel\LogChannel::class,
'level' => 'debug',
],
],Then use it:
Log::channel('logtide')->info('Hello from Laravel!');
// Or set as default in .env:
// LOG_CHANNEL=logtideuse LogTide\Laravel\LogtideFacade as Logtide;
Logtide::info('User logged in', ['user_id' => 123]);
Logtide::captureException($exception);All enabled by default in config/logtide.php:
- DB Queries - records SQL queries as breadcrumbs (via
QueryBreadcrumbIntegration) - Cache - records cache hits, misses, writes (via
CacheBreadcrumbIntegration) - Queue - records job processing events (via
QueueIntegration)
MIT License - see LICENSE for details.
