Repository navigation
Redaction gaps closed, MariaDB < 10.10 support fixed, and an opt-in minimum
level for capture-all mode. Has a migration — run php artisan migrate.
It changes nothing on MySQL 8, MariaDB 10.10+, Postgres or SQLite.
Upgrading
- The migration only touches an install that already has the bug (MariaDB before 10.10 or MySQL 5.7, with
explicit_defaults_for_timestampoff). There it changes the column type, which MySQL and MariaDB do by copying the whole table:log_entriesis locked for writes until the copy finishes, so on a large table new log writes wait for that long. Prune first (php artisan logscope:prune) and run it off-peak. Everywhere else it reads the schema and returns. - If you published LogScope's migrations, your copies keep their old content — a published file with the same name replaces the package's. On MariaDB before 10.10 in strict mode the old
2026_09_23_000001copy still fails withInvalid default value for 'last_seen_at'before the repair can run. Republish withphp artisan vendor:publish --tag=logscope-migrations --force(this overwrites every published LogScope migration, so re-apply any edits you made), or changetimestamp(...)todateTime(...)foroccurred_at,first_seen_atandlast_seen_atin your copies. WithLOGSCOPE_MIGRATIONS_ENABLED=falsethe repair migration only runs once published. - More fields now read
[REDACTED].cookie,sessionandxsrfmatch as a fragment inside a key, so harmless-looking fields such ascookie_consent,cookies_accepted,session_count,session_lifetime,sessions,xsrf_enabledandpossessionare redacted in new entries. Name any you need incontext.sensitive_keys_exceptto keep them;php artisan logscope:doctorshows what is redacted.
Security
- A header bag logged as an array kept the session cookie and the Basic-auth password.
Log::info('…', ['headers' => $request->headers->all()])is matched bysensitive_keys, notsensitive_headers, and none ofcookie,set-cookie,x-xsrf-tokenorphp-auth-pw(which splits into php/auth/pw) matched a default key.cookie,session,xsrfandphp_auth_pware now default keys. Because keys match as a fragment inside a word, fields such assession_countorcookie_consentnow read[REDACTED]too; name them insensitive_keys_exceptto keep them. - The Referer header was stored with its query string.
refereris in the default header allowlist, so a page's?token=…reached theheaderscolumn. Its query now goes throughsensitive_keyslike the entry's ownurl, keeping the origin, path and other parameters; a relative (/cb?token=…) or scheme-less Referer is redacted too. This also applies to a logged Request's headers, and to a header or server bag logged as an array ($request->headers->all(),$request->server->all()): the query in areferer,HTTP_REFERER,REQUEST_URIorQUERY_STRINGkey is redacted the same way. Other URL-looking keys, such as your ownurl, are left as logged.codeis not a default key (it would blankstatus_code,country_code), so an OAuth server should add it tosensitive_keysto cover?code=in both the url and the Referer.
Fixed
- MariaDB before 10.10:
occurred_atchanged on every update, andlog_groupscould not be created. Withexplicit_defaults_for_timestampoff (the default before MariaDB 10.10, and on MySQL 5.7) the server gavelog_entries.occurred_atON UPDATE CURRENT_TIMESTAMP, so a status change, note or fingerprint backfill overwrote when the log happened; the 2.3.0 migration then failed withInvalid default value for 'last_seen_at'. New installs create these columns asdatetime. The new migration repairsoccurred_at,first_seen_atandlast_seen_atonly where the server gave them a default, which rebuilds those tables once; healthy installs are left alone. A failed 2.3.x migration now completes on the nextmigrate. Times already overwritten can't be recovered.
Added
ignore.min_level(LOGSCOPE_MIN_LEVEL). Capture-all mode reads every log the app writes, so your channels'LOG_LEVELnever applied andLog::debug()filled the table. SetLOGSCOPE_MIN_LEVEL=info, or"${LOG_LEVEL}"to follow your channels. Unset by default, so nothing changes on upgrade. Takes a level name, a Monolog value (200) or aMonolog\Level. An unknown one is reported toerror_logand filters nothing.