Configuration

The bundle is configured under a single monitor tree, conventionally in config/packages/monitor.yaml. Every value maps directly onto the monitor-php core types the bundle wires for you.

Full reference

yaml
# config/packages/monitor.yaml
monitor:
    enabled: true
    url: '%env(MONITOR_URL)%'
    key: '%env(MONITOR_KEY)%'
    timeout: 3
    release: '%env(default::MONITOR_RELEASE)%'
    trace_limit: 0    # 0 = full trace (default); a positive value trims
    environments: []
    scrub: ['password', 'passphrase', 'token', 'secret', 'authorization', 'cookie', 'referer', 'referrer', 'api_key']
    logs:
        enabled: false
        level: warning
        max_batch: 200

Options

KeyTypeDefaultDescription
enabledbooltrueMaster switch. When false, the bundle registers no services at all, nothing is captured.
urlstringnullBase URL of your Quiet Guard server. Endpoint paths are appended to it; a trailing slash is trimmed.
keystringnullThe per-project API token, sent as Authorization: Bearer <key>.
timeoutint3Per-request transport timeout, in seconds.
releasestringnullOptional release identifier (e.g. a commit SHA) attached to exception and log context.
trace_limitint00 (the default) ships the full stack trace with every exception; a positive value trims the payload to that many frames.
environmentslist of string[]Report only from these environments. Empty means report from all environments. Matched against kernel.environment.
scrublist of stringsee belowContext keys whose values are masked before sending (recursive, case-insensitive).
logs.enabledboolfalseTurn log forwarding on. The handler service is always registered while the bundle is enabled; when false it drops every record. You still have to attach it to Monolog, see Usage.
logs.levelstringwarningMinimum level the handler captures (a Monolog level name).
logs.max_batchint200Flush the log buffer to the server once it reaches this many records.

Default scrub keys

When you do not set scrub, the bundle uses:

password, passphrase, token, secret, authorization, cookie, referer,
referrer, api_key

Setting scrub replaces this list, so include the defaults you still want to keep.

Environment variables

Nothing forces you to use environment variables, but it is the recommended pattern so secrets stay out of the repository. A typical wiring:

yaml
# config/packages/monitor.yaml
monitor:
    url: '%env(MONITOR_URL)%'
    key: '%env(MONITOR_KEY)%'
    release: '%env(default::MONITOR_RELEASE)%'
    environments: ['prod']
dotenv
# .env.local
MONITOR_URL=https://monitor.example.com
MONITOR_KEY=your-project-token
MONITOR_RELEASE=

The %env(default::MONITOR_RELEASE)% form falls back to an empty value when the variable is unset, so release simply stays empty.

Restricting environments

By default (environments: []) the bundle reports from every environment, including dev. To report only from production:

yaml
monitor:
    environments: ['prod']

Both the exception subscriber and the Monolog log handler check this list against kernel.environment before sending anything, so in any other environment nothing leaves your application, neither exceptions nor logs.

How the config maps to services

ConfigService built
url, key, timeout, release, environments, trace_limitmonitor.config (Config)
scrubmonitor.scrubber (Scrubber)
trace_limit, releasemonitor.payload_builder (ExceptionPayloadBuilder)
monitor.http_client (CurlHttpClient), monitor.reporter (Reporter), monitor.exception_subscriber
logs.*monitor.log_handler (MonitorHandler), always registered while the bundle is enabled; with logs.enabled: false it drops every record, so a monolog.yaml referencing it keeps compiling

See Usage for how these services behave at runtime.

You are reading the Symfony Bundle v1.0 documentation.