Skip to content

Latest commit

 

History

History
149 lines (110 loc) · 8.94 KB

File metadata and controls

149 lines (110 loc) · 8.94 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.8.2] - 2026-08-21

Fixed

  • Fixed Deprecated: Constant E_STRICT is deprecated since 8.4, the error level was removed notices emitted on PHP 8.4 and 8.5. ErrorListenerIntegration::severityToLevel() and ErrorSerializer::errorLevelToString() still referenced E_STRICT. Both are match arms evaluated lazily, so the constant was only touched for notice and deprecation level diagnostics, which is why every such diagnostic produced two extra deprecation lines. Because the deprecation is raised from inside the error handler and PHP does not re-enter a user handler while it is already running, those lines were printed by PHP itself instead of being captured, polluting responses when display_errors is on. The E_STRICT level was removed in PHP 8.0 and this package requires ^8.1, so both branches were unreachable and removing them changes no behaviour. It also avoids a fatal Undefined constant "E_STRICT" inside the error handler on PHP 9.0. Closes #7.
  • Removed a ReflectionProperty::setAccessible() call from the test suite, deprecated in PHP 8.5 and a no-op since 8.1.

Changed

  • phpunit.xml now sets failOnDeprecation="true" and CI runs the test matrix on PHP 8.5 as well, so this class of issue breaks the build instead of passing silently.

[0.8.1] - 2026-06-11

Added

  • sample_rate option (0.0–1.0, default 1.0): per-entry log sampling, applied after before_send (traces_sample_rate keeps governing spans)

[0.8.0] - 2026-06-11

Added

  • Every entry now carries metadata.sdk = {"name": "logtide-php", "version": ...} (LogTide\Version; caller-provided sdk key wins)

[0.7.4] - 2026-04-14

Fixed

  • Fixed Options::$service being silently ignored for any log captured without an explicit per-call service. Client::prepareEvent used $event->getService() ?: $this->options->getService(), but Event::__construct defaults $service to the string 'unknown', which is truthy — so the Elvis operator never fell through to the option. As a result, calls like LogtideSdk::init(['service' => 'my-php-app']) followed by captureLog(...) always shipped service: "unknown". The fallback now triggers when the event service is '' or 'unknown'. Closes #7.

[0.7.3] - 2026-04-07

Fixed

  • Fixed Event::$time formatting that produced ISO 8601 with a numeric offset (e.g. 2026-04-07T11:34:24+00:00) via format('c'). Logtide's backend uses Zod's strict z.string().datetime(), which only accepts ISO 8601 ending in Z, so every captureLog(...) call was rejected with HTTP 400 "Validation error". The SDK now emits UTC ISO 8601 with a Z suffix (2026-04-07T11:34:24.886Z). Closes #180.
  • Fixed empty metadata field being serialized as JSON array [] instead of object {}. The backend schema is metadata: z.record(z.unknown()).optional(), which rejects arrays with "Expected object, received array". Default captureLog(...) calls without any metadata now serialize metadata as an empty JSON object via \stdClass, so the first-time-user happy path validates cleanly.
  • Fixed OTLP startTimeUnixNano, endTimeUnixNano, and span event timeUnixNano being emitted in scientific notation (e.g. "1.7755623882398E+18") due to a naive (string) ($float * 1e9) cast. OTLP requires a digit-only stringified uint64, which would cause the OTLP traces endpoint to reject the payload. The SDK now uses sprintf('%.0f', ...) to emit a fixed-point integer string.

0.7.2 - 2026-03-19

Fixed

  • Fixed ErrorListenerIntegration closure return type from : bool to ?bool — the previous error handler can return null, causing a TypeError at runtime. Closes #6.
  • Added typed callable shapes via PHPDoc to Options::$beforeSend, Options::$beforeBreadcrumb, and Options::$integrations so PHPStan can validate callback signatures at static analysis time.
  • Tightened Scope::$eventProcessors and Scope::$globalEventProcessors PHPDoc from callable[] to array<callable(Event): ?Event>, and annotated addEventProcessor / addGlobalEventProcessor accordingly.

0.7.1 - 2026-03-19

Fixed

  • Fixed ^0.1 version constraint on logtide/logtide in all integration packages — Composer treats ^0.1 as >=0.1.0 <0.2.0, so v0.7.0 was not installable. Constraint updated to ^0.7 in logtide-laravel, logtide-symfony, logtide-slim, and logtide-wordpress. Closes #5.

0.7.0 - 2026-03-06

Added

Monorepo Structure

  • Restructured as Composer monorepo with 5 packages under packages/*
  • Unified test suite with PHPUnit 10.5 (265 tests, 570 assertions)
  • PHPStan level 8 static analysis across all packages
  • PSR-12 code style enforcement with PHP_CodeSniffer

Core (logtide/logtide)

  • LogtideSdk - static entry point for SDK initialization
  • ClientBuilder - fluent client construction with sensible defaults
  • 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
  • HttpTransport and OtlpHttpTransport for log and span delivery
  • CurlHttpClient and GuzzleHttpClient HTTP client implementations
  • DSN parsing, error serialization, trace ID generation
  • W3C Trace Context (traceparent) propagation
  • Breadcrumb buffer with configurable max size
  • Monolog handlers: LogtideHandler and BreadcrumbHandler
  • PSR-15 middleware for generic HTTP request tracing
  • Global helper functions (\LogTide\init(), \LogTide\captureException(), etc.)
  • Built-in integrations: Request, Environment, ExceptionListener, ErrorListener, FatalErrorListener

Laravel (logtide/logtide-laravel)

  • LogtideServiceProvider with auto-discovery and publishable config
  • LogtideMiddleware for automatic request tracing
  • LogChannel for Laravel logging integration
  • LogtideFacade for static access
  • Breadcrumb integrations: DB queries, cache operations, queue jobs

Symfony (logtide/logtide-symfony)

  • LogtideBundle with DI extension and semantic configuration
  • RequestSubscriber for automatic HTTP request tracing
  • ConsoleSubscriber for CLI command tracing
  • SymfonyIntegration and DoctrineIntegration for breadcrumbs

Slim (logtide/logtide-slim)

  • LogtideMiddleware - PSR-15 middleware for request tracing
  • LogtideErrorMiddleware - error capture with full request context
  • Automatic route pattern resolution from Slim routing

WordPress (logtide/logtide-wordpress)

  • LogtideWordPress - static initializer with WordPress hook registration
  • Lifecycle hooks: wp_loaded, shutdown, wp_die_handler, wp_redirect, wp_mail
  • WordPressIntegration - PHP error handler integration
  • DatabaseIntegration - slow query breadcrumbs via $wpdb
  • HttpApiIntegration - outgoing HTTP request breadcrumbs
  • Multisite support (blog switch tracking, plugin activation/deactivation)

CI/CD

  • GitHub Actions CI: PHPUnit tests, PHPStan, PHPCS on push/PR to main/develop
  • GitHub Actions publish: Packagist publish on tag v*.*.* or manual dispatch
  • PHP version matrix: 8.1, 8.2, 8.3, 8.4
  • Branch model: developmain, hotfix directly to main

Documentation

  • README for every package with badges, quick start, API reference
  • Root README with package table, architecture diagram, development guide
  • Contributing guide, Code of Conduct, Changelog
  • Branch protection documentation (.github/BRANCH_PROTECTION.md)

0.1.0 - 2026-01-13

Added

  • Initial release of LogTide PHP SDK
  • Automatic batching with configurable size and interval
  • Retry logic with exponential backoff
  • Circuit breaker pattern for fault tolerance
  • Max buffer size with drop policy
  • Query API for searching and filtering logs
  • Live tail with Server-Sent Events (SSE)
  • Aggregated statistics API
  • Trace ID context for distributed tracing
  • Global metadata support
  • Structured error serialization
  • Internal metrics tracking
  • Logging methods: debug, info, warn, error, critical
  • Laravel middleware for auto-logging HTTP requests
  • Symfony event subscriber for auto-logging HTTP requests
  • PSR-15 middleware for Slim, Mezzio, and other frameworks
  • Full PHP 8.1+ support with strict types and enums