Skip to content

logtide-dev/logtide-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogTide Logo

logtide/logtide-laravel

Packagist License Laravel

LogTide integration for Laravel - automatic request tracing, error capture, and breadcrumbs.


Features

  • Automatic request tracing via HTTP middleware
  • Error capture with full request context
  • W3C Trace Context propagation (traceparent in/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

Installation

composer require logtide/logtide-laravel

The service provider is auto-discovered. No manual registration needed.


Quick Start

  1. Add your DSN to .env:
LOGTIDE_DSN=https://lp_your_key@your-logtide-instance.com
  1. Optionally publish the config:
php artisan vendor:publish --tag=logtide-config

That's it! HTTP requests are automatically traced, exceptions captured, and DB queries recorded as breadcrumbs.


Configuration

// 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'],
];

Using the Log Channel

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=logtide

Using the Facade

use LogTide\Laravel\LogtideFacade as Logtide;

Logtide::info('User logged in', ['user_id' => 123]);
Logtide::captureException($exception);

Breadcrumb Integrations

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)

License

MIT License - see LICENSE for details.

Links

About

LogTide Laravel integration - ServiceProvider, middleware, log channel (read-only split from logtide-php)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages