PHPackages                             logtide/logtide - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. logtide/logtide

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

logtide/logtide
===============

Official PHP SDK for LogTide - log management with Hub/Scope architecture, tracing, breadcrumbs, and integrations

v0.7.4(2mo ago)0374MITPHPPHP ^8.1

Since Mar 6Pushed 2mo agoCompare

[ Source](https://github.com/logtide-dev/logtide-php-sdk)[ Packagist](https://packagist.org/packages/logtide/logtide)[ RSS](/packages/logtide-logtide/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (12)Versions (6)Used By (4)

 [![LogTide Logo](https://raw.githubusercontent.com/logtide-dev/logtide/main/docs/images/logo.png)](https://raw.githubusercontent.com/logtide-dev/logtide/main/docs/images/logo.png)

logtide/logtide
===============

[](#logtidelogtide)

 [![Packagist](https://camo.githubusercontent.com/0f048d5c5d3c3efb04671fd48b77a62f6332e67a8e5021f55ac23f0b903478f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f67746964652f6c6f67746964653f636f6c6f723d626c7565)](https://packagist.org/packages/logtide/logtide) [![License](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](../../LICENSE) [![PHP](https://camo.githubusercontent.com/638e69a9ab1080dccb01716be78e182016bdeb34580c2e7070b120086d40df0e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d707572706c652e737667)](https://www.php.net/)

 Core client, hub, transports, and utilities for the [LogTide](https://logtide.dev) PHP SDK ecosystem.

---

Features
--------

[](#features)

- **Client** - capture logs, errors, breadcrumbs, and spans
- **Hub** - global singleton for convenient access across your app
- **Scope** - per-request context isolation with tags, extras, and breadcrumbs
- **BatchTransport** - automatic batching with retry logic and circuit breaker
- **Distributed tracing** - W3C Trace Context (`traceparent`) propagation
- **Monolog integration** - `LogtideHandler` and `BreadcrumbHandler`
- **PSR-15 middleware** - generic HTTP request tracing
- **Built-in integrations** - error/exception listeners, request and environment capture

Installation
------------

[](#installation)

```
composer require logtide/logtide
```

> **Note:** You typically don't need to install this package directly. Use a framework-specific package like `logtide/logtide-laravel`, `logtide/logtide-symfony`, etc. which include `logtide/logtide` as a dependency.

---

Quick Start
-----------

[](#quick-start)

### Using global helper functions (recommended)

[](#using-global-helper-functions-recommended)

```
\LogTide\init([
    'dsn' => 'https://lp_your_key@your-instance.com',
    // Or use api_url + api_key instead of dsn:
    // 'api_url' => 'https://your-instance.com',
    // 'api_key' => 'lp_your_key',
    'service' => 'my-app',
]);

// Log messages
\LogTide\info('Server started', ['port' => 8080]);
\LogTide\error('Payment failed', ['order_id' => 456]);

// Capture exceptions
try {
    dangerousOperation();
} catch (\Throwable $e) {
    \LogTide\captureException($e);
}

// Add breadcrumbs
\LogTide\addBreadcrumb(new \LogTide\Breadcrumb\Breadcrumb(
    \LogTide\Enum\BreadcrumbType::HTTP,
    'GET /api/users',
    category: 'http.request',
));

// Graceful shutdown (automatic via register_shutdown_function)
\LogTide\flush();
```

### Using the Hub directly

[](#using-the-hub-directly)

```
use LogTide\LogtideSdk;
use LogTide\Enum\LogLevel;

$hub = LogtideSdk::init([
    'dsn' => 'https://lp_your_key@your-instance.com',
    'service' => 'my-app',
]);

// Log messages
$hub->captureLog(LogLevel::INFO, 'Request handled', ['user_id' => 123]);

// Scoped context
$hub->configureScope(function ($scope) {
    $scope->setTag('request_id', 'abc-123');
    $scope->setUser(['id' => 42]);
});

// Isolated scope
$hub->withScope(function () use ($hub) {
    $hub->getScope()->setTag('temp', 'value');
    $hub->captureLog(LogLevel::DEBUG, 'Scoped log');
});
```

---

Configuration
-------------

[](#configuration)

OptionTypeDefaultDescription`dsn``string`-DSN string: `https://lp_KEY@host``api_url``string`-API URL (alternative to DSN)`api_key``string`-API key (alternative to DSN)`service``string``'unknown'`Service name for log attribution`environment``string``null`Environment (e.g. `production`, `staging`)`release``string``null`Release / version identifier`batch_size``int``100`Logs to batch before sending`flush_interval``int``5000`Auto-flush interval in ms`max_buffer_size``int``10000`Max logs in buffer before dropping`max_retries``int``3`Max retry attempts on failure`retry_delay_ms``int``1000`Initial retry delay (exponential backoff)`circuit_breaker_threshold``int``5`Failures before opening circuit`circuit_breaker_reset_ms``int``30000`Time before retrying after circuit opens`max_breadcrumbs``int``100`Max breadcrumbs to keep`traces_sample_rate``float``1.0`Sample rate for traces (0.0 to 1.0)`debug``bool``false`Enable debug logging`attach_stacktrace``bool``false`Attach stack traces to log entries`send_default_pii``bool``false`Send personally identifiable information`transport``TransportInterface``null`Custom transport (overrides default)`integrations``array|Closure``null`Integrations to install`before_send``Closure``null`Modify or drop events before sending`before_breadcrumb``Closure``null`Modify or drop breadcrumbs`ignore_exceptions``string[]``[]`Exception classes to ignore`tags``array``[]`Global tags for all events`global_metadata``array``[]`Global metadata for all events---

Distributed Tracing
-------------------

[](#distributed-tracing)

```
use LogTide\Tracing\PropagationContext;

// Parse incoming traceparent header
$traceparent = $request->getHeaderLine('traceparent');
\LogTide\continueTrace($traceparent);

// Start a span
$span = \LogTide\startSpan('db.query', [
    'kind' => \LogTide\Enum\SpanKind::CLIENT,
]);

// ... do work ...

// Finish the span
\LogTide\finishSpan($span);

// Get traceparent for outgoing requests
$outgoingHeader = \LogTide\getTraceparent();
```

---

Monolog Integration
-------------------

[](#monolog-integration)

```
use Monolog\Logger;
use LogTide\Monolog\LogtideHandler;
use LogTide\Monolog\BreadcrumbHandler;

$logger = new Logger('app');

// Send logs to LogTide
$logger->pushHandler(new LogtideHandler());

// Record logs as breadcrumbs
$logger->pushHandler(new BreadcrumbHandler());

$logger->info('Hello from Monolog!');
```

---

License
-------

[](#license)

MIT License - see [LICENSE](../../LICENSE) for details.

Links
-----

[](#links)

- [LogTide Website](https://logtide.dev)
- [Documentation](https://logtide.dev/docs)
- [GitHub](https://github.com/logtide-dev/logtide-php)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

5

Last Release

70d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40077351?v=4)[Polliog](/maintainers/Polliog)[@Polliog](https://github.com/Polliog)

---

Top Contributors

[![Polliog](https://avatars.githubusercontent.com/u/40077351?v=4)](https://github.com/Polliog "Polliog (9 commits)")

---

Tags

logginglogtideobservabilitypackagistphpsdktracingloggingmonitoringtracingobservabilitylogtide

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/logtide-logtide/health.svg)

```
[![Health](https://phpackages.com/badges/logtide-logtide/health.svg)](https://phpackages.com/packages/logtide-logtide)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M315](/packages/open-telemetry-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
