Download the PHP package applogger/sdk-core without Composer

On this page you can find all versions of the php package applogger/sdk-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk-core

applogger/sdk-core

Framework-agnostic PHP error-tracking and log aggregation SDK for AppLogger — the EU-hosted, privacy-first application monitoring platform. This package is the core that framework adapters (e.g. applogger/symfony-bundle) build on. It speaks PSR-3 (log interface), PSR-18 (HTTP client), and PSR-17 (HTTP factories), and is designed to never throw into the host application under any circumstances.

PHP ^8.3 License MIT


Features


Requirements


Installation

Stability note: until a stable tagged release is published this package tracks dev-master. Consumers that have "minimum-stability": "stable" (the Composer default) must add:

Framework adapters that already require the bundle (e.g. applogger/symfony-bundle) typically pin a compatible stability themselves.


Quick Start

Global function API

The global functions in src/functions.php are auto-loaded by Composer and provide the fastest integration path for plain PHP applications.

Hub — DI / framework-adapter entry point

Framework adapters use Hub directly instead of the global functions, so they can wire the hub into the DI container.

The Symfony bundle (applogger/symfony-bundle) constructs a Hub via its DI container and never calls the global init(); it uses Hub::setCurrent() so the global functions still delegate to the same instance.


DSN Format

Examples:

Important: the DSN must NOT contain userinfo (user@ or user:pass@). A DSN with a @ in the authority is explicitly rejected by Dsn::tryParse() and resolves to null, which causes the SDK to use a NullTransport (no events sent, no error thrown).

Authentication is passed via the api_key option, which the SDK sends as the X-Application-Logger-Api-Key request header. The dsn option carries only the routing information (host + project ID).


Configuration Reference

All options are passed as a flat array to init() (or Options::fromArray()). Unknown keys are warned via the configured logger and silently ignored.

Option Type Default Description
dsn string null Ingest DSN (scheme://host/projectId, no userinfo). Required to send error events.
api_key string null API key sent as X-Application-Logger-Api-Key. Required by the platform.
environment string 'production' Environment label attached to every event (production, staging, etc.).
release string\|null null Application version / release identifier (e.g. 1.4.2, git SHA).
enabled bool true Master switch. When false, all captures are no-ops.
sample_rate float 1.0 Fraction of events to actually send (0.0–1.0). 1.0 = send all.
max_breadcrumbs int 50 Maximum number of breadcrumbs retained per scope. Minimum 1.
logger LoggerInterface NullLogger Internal SDK logger for warnings/debug output (not your application logger).
before_send \Closure null Called with (Event $event): ?Event before each send. Return null to drop the event.
circuit_breaker array see below Circuit breaker configuration sub-array.
circuit_breaker.failure_threshold int 5 Number of consecutive failures before the circuit opens.
circuit_breaker.timeout int 60 Seconds the circuit stays open before attempting half-open. Minimum 10.
circuit_breaker.half_open_attempts int 1 Test requests allowed while half-open.
max_buffered_events int 100 Maximum events buffered in memory before older ones are discarded.
flush_budget float 2.0 Wall-clock cap (seconds) on the post-response/shutdown telemetry drain. Clamped 0.05–5.0.
timeout float 2.0 Per-request HTTP timeout in seconds. Clamped 0.5–5.0.
cache_dir string sys_get_temp_dir().'/applogger-sdk' Filesystem directory for circuit-breaker and rate-limiter state.
session_hash_salt string derived from DSN Salt used when hashing session identifiers.
scrub_fields string[] ['password','passwd','secret','token','api_key','auth','credential'] Field-name fragments (case-insensitive substring) whose values are replaced with [REDACTED].
flush_mode string 'auto' Delivery mode: 'auto' (detect), 'web' (FastCGI), 'worker' (FrankenPHP/Swoole/RoadRunner), 'cli'.
default_integrations bool true Register the global error/exception/shutdown handler (ErrorHandler) automatically.
log_endpoint string\|null null Log aggregation endpoint (https://…). Both log_endpoint and log_token must be set to enable logging.
log_token string\|null null Log API token (typically sk_log_…).
app_name string\|null null Application name attached to log records.

Log Aggregation

The SDK ships two independent pipelines through a single init() call:

  1. Error trackingcaptureException / captureMessagePOST {dsn-host}/api/v1/errors (PostgreSQL, fingerprinted + grouped). Auth: X-Application-Logger-Api-Key.
  2. Log aggregationlogger() PSR-3 bridge → buffered → POST {log_endpoint}/v1/logs/batch (ClickHouse). Auth: X-Api-Key header with log_token.

Logging is disabled when either log_endpoint or log_token is absent — logger() returns a NullLogger and no network calls are made.

Log records are flushed automatically on shutdown when default_integrations is enabled.


Resilience and Design Guarantees


CLI / Diagnostics

vendor/bin/applogger is a zero-dependency CLI that runs a self-check against an SDK configuration.

The CLI runs five checks and prints a [OK] / [WARN] / [FAIL] / [INFO] line for each:

Check What it verifies
DSN DSN parses to a valid scheme://host/projectId (no userinfo).
Transport A PSR-18 HTTP client is discoverable; reports NullTransport degradation if not.
Cache The cache_dir is writable (circuit-breaker/rate-limit state persistence).
Logging log_endpoint + log_token are set and a log client can be constructed.
Test event Sends a real Diagnostic event to the configured DSN and expects HTTP 202 or 409.

The same checks are available programmatically:


Versioning

This package follows Semantic Versioning once a stable tag is published. It is currently pre-release (dev-master / 1.0-dev). Breaking changes within the 1.x series will not be made without a major-version bump.


License

MIT — see LICENSE.


Links


All versions of sdk-core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
ext-mbstring Version *
psr/log Version ^2|^3
psr/http-client Version ^1
psr/http-factory Version ^1.1
psr/cache Version ^2|^3
psr/clock Version ^1
php-http/discovery Version ^1.20
nyholm/psr7 Version ^1.8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package applogger/sdk-core contains the following files

Loading the files please wait ...