Download the PHP package sirix/sentry-psr without Composer

On this page you can find all versions of the php package sirix/sentry-psr. 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 sentry-psr

sirix/sentry-psr

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

PSR-15 & PSR-11 integration for Sentry with long-running-safe HTTP and console lifecycle handling.

This library provides:

Requirements

Logger integration uses the required PSR-3 psr/log interface. Concrete logger implementations such as monolog/monolog remain optional.

Optional integrations are intentionally not required for HTTP-only projects:

Installation

Configuration

Use sentry for native Sentry SDK options and sentry_psr for this package's integration/lifecycle behavior.

sentry_psr is required at runtime. Copy the provided baseline config from src/config/sentry.global.php into your application config, then adjust it for your project. The ConfigProvider wires services only; it does not inject runtime defaults.

sentry vs sentry_psr

Invalid container services, missing sentry_psr, or invalid config value types are reported through sirix/container-resolver exceptions, so misconfiguration fails early and with context.

Exception filtering

Use sentry_psr.exception_filter to suppress expected exceptions before this package calls captureException(). Filtered exceptions are still rethrown by the HTTP middleware and still flow through Symfony Console, but they are not sent to Sentry, not logged by this package as captured errors, and do not trigger the HTTP/error flush path.

ignore_classes matches class and interface inheritance and every entry must resolve to an existing class or interface during config validation. ignore_http_statuses checks getStatusCode(), getStatus() and then the throwable code when it looks like an HTTP status code. ignore_codes checks the raw throwable code. ignore_message_patterns accepts valid regex patterns. When inspect_previous=true, the same rules are applied to the previous-exception chain.

The configured filter is created by this package's HTTP, console and reporter factories. For domain-specific logic, register a Sirix\SentryPsr\ExceptionFilter\ExceptionFilterInterface service in your container:

Console input redaction

Console command arguments and options are redacted with a Sentry-specific sirix/redaction redactor configured from sentry_psr.redaction before they are attached to Sentry command context. The listener intentionally does not reuse an application-wide Sirix\Redaction\RedactorInterface service, so Sentry console sanitization remains isolated and predictable.

By default, keys matching password|passwd|secret|token|api[_-]?key|authorization|cookie are replaced with [Filtered], recursively and with traversal limits suitable for long-running workers. You can opt in to additional exact-key and regex-key redaction rules:

Supported rule types are fixed_value, full_mask, start_end, unicode_start_end, email, phone, name, null and offset. use_default_rules=false is the baseline because the default sirix/redaction rules are intentionally broad and may hide more Sentry context than expected.

HTTP filtering is intentionally separate: request headers still use the http_context allowlist/blocklist model and are not controlled by console redaction settings. Raw query strings and request targets are not captured unless sentry_psr.http_context.capture_query_string=true.

Default integrations

default_integrations defaults to false through sentry_psr.default_integrations unless you explicitly set sentry.default_integrations.

This package intentionally avoids registering global SDK error/exception handlers by default so embedding applications and long-running workers remain in control of capture lifecycle. If you want the standard Sentry SDK integrations, opt in explicitly:

DI Container wiring

ConfigProvider registers services only. Runtime options must be provided by your application config, usually by copying src/config/sentry.global.php.

ConfigProvider registers:

Console-related services are registered only when Symfony Console and EventDispatcher classes are available:

Aliases registered with console integration:

Long-running applications

When using this package in long-running PHP processes, make sure every request, job or command is executed inside an isolated Sentry scope. Otherwise user, tag, context and breadcrumb data may leak between independent units of work.

Version 2 behavior is long-running safe by default:

HTTP pipeline placement

Place SentryErrorMiddleware as early as possible so it wraps application middleware that might add Sentry context:

If the middleware is not outermost, only downstream middleware/handlers are covered by the isolated scope.

Mezzio under RoadRunner

After copying the baseline config, these are the typical long-running HTTP values to keep or review:

For async/buffered transports, call SentryLifecycle::flush() from your worker shutdown hook, or enable targeted flush points where needed.

Queue consumer / manual job lifecycle

HTTP context and sensitive data

HTTP context enrichment is enabled by default and stores method, path, host, scheme, selected scalar attributes and request/correlation id. Raw query strings and request targets are excluded by default and require sentry_psr.http_context.capture_query_string=true.

Sensitive data is excluded by default:

Headers are not captured unless sentry_psr.http_context.capture_headers=true, and even then only allowed_headers are included. Sensitive header names remain blocked.

Console integration

Install the optional console dependencies before enabling this integration:

SentryCommandListener subscribes to:

Set sentry_psr.log_console_command_start=false to disable the PSR-3 Console command started info log while keeping command breadcrumbs and error reporting enabled.

Manual wiring:

Console arguments/options are captured by default, but keys containing password, secret, token, api key, authorization or cookie are filtered.

Reporter API

Prefer SentryReporter from your container:

Static helper removal

Sirix\SentryPsr\Helper\SentryHelper was removed in 2.0. Use SentryReporter through DI instead, so the hub and scope are explicit and safe for long-running applications.

Global current hub

SentryHubFactory creates a hub explicitly through ClientBuilder and Hub.

By default sentry_psr.set_current_hub=true, so Sentry SDK global functions continue to use the configured hub. Set it to false if your application wants fully explicit DI-only hub usage:

If disabled, code using Sentry\captureException() or SentrySdk::getCurrentHub() will not automatically use this package's hub.

Migration

See UPGRADE-2.0.md for breaking changes and migration steps from 1.x.

Development

Useful Composer scripts:

License

MIT © Sirix


All versions of sentry-psr with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
psr/container Version ^1.1 || ^2.0
psr/http-message Version ^1.0 || ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^1.0 || ^2.0 || ^3.0
sentry/sentry Version ^4.0
sirix/container-resolver Version ^0.1.2
sirix/redaction Version ^2.1
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 sirix/sentry-psr contains the following files

Loading the files please wait ...