Skip to content

Configuration reference

Publish the annotated config with php artisan vendor:publish --tag=stopwatch-config, or set the env vars below. The file itself is config/stopwatch.php.

Core

SettingEnvDefaultEffect
enabledSTOPWATCH_ENABLEDtruefalse makes every call a no-op
outputSTOPWATCH_OUTPUTsilentdefault mode: silent, log, stderr, dump
log_levelSTOPWATCH_LOG_LEVELdebuglevel used when output is log
slow_thresholdSTOPWATCH_SLOW_THRESHOLD50ms above which a checkpoint reads as slow

Per feature

FeatureEnv vars
TrackingSTOPWATCH_TRACK_QUERIES, STOPWATCH_TRACK_MEMORY, STOPWATCH_TRACK_HTTP
NotificationsSTOPWATCH_NOTIFY_THRESHOLD, STOPWATCH_MAIL_TO, STOPWATCH_MAIL_SUBJECT
ToolbarSTOPWATCH_INJECT, STOPWATCH_INJECT_AUTO_REGISTER, STOPWATCH_INJECT_ENVIRONMENTS, STOPWATCH_INJECT_POSITION, STOPWATCH_INJECT_SLOW_REQUEST_MS, STOPWATCH_INJECT_TRACK

Run log

EnvDefaultEffect
STOPWATCH_LOG_RUNSfalsemaster toggle
STOPWATCH_LOG_DIRstorage/stopwatch/runsstorage path
STOPWATCH_LOG_MIN_DURATION_MS50skip faster runs; 0 logs everything
STOPWATCH_LOG_DETAILsummaryfull appends per-call SQL and HTTP tables
STOPWATCH_LOG_INCLUDE_BINDINGSfalsepersist SQL bindings in full mode (PII opt-in)
STOPWATCH_LOG_EXCEPTIONS_MESSAGEfalsepersist $e->getMessage() (PII opt-in)
STOPWATCH_LOG_COLLECT_CONTEXTfalsecapture visible Context::all()
Retention, exception and context knobs
EnvDefaultEffect
STOPWATCH_LOG_MAX_FILES200retained files; oldest pruned
STOPWATCH_LOG_MAX_AGE_DAYS7soft age cap, probabilistic prune
STOPWATCH_LOG_SKIP_EMPTYtrueskip runs with zero checkpoints
STOPWATCH_LOG_COLLECT_EXCEPTIONStruecapture class, file, line and trace
STOPWATCH_LOG_EXCEPTIONS_MESSAGE_MAX_CHARS500codepoint cap before
STOPWATCH_LOG_EXCEPTIONS_TRACE_FRAMES10frame cap; 0 omits the trace
STOPWATCH_LOG_CONTEXT_VALUE_MAX_BYTES4096per-value byte cap

Array-typed options live under run_log.options in the config file, since env cannot express arrays:

PathEffect
exceptions.mask_message_matchingpatterns replaced with ***; leading / is a preg, otherwise substring. Applied after the cap
exceptions.trace_exclude_pathssubstring match on frame.file, to hide vendor noise
context.allowallowlist; empty means all visible scalar keys. Rich objects need listing
context.denydenylist, applied after allow
context.maskreplace the value with ***, keep the key
context.frontmatter_keyspromote scalars to ctx_<key> frontmatter, sortable from the list view