This PR defaults the log handler to use JsonFormatter (formerly BasicJsonFormatter), and drops our SmartJsonFormatter class entirely.
Doing this drastically simplifies this package:
We rely entirely on Monolog's JSON formatting, which is solid and well tested.
Our stack traces should be smaller, which will mean less bandwidth.
We no longer need sensitive parameter redactions or deep file path exclusion, because the stack trace doesn't include every parameter passed to every method (e.g. database connections) in the stack trace.
We no longer need to check the size of the JSON is less than 30kb before, again because the stack trace is much simpler, so it's highly unlikely to ever get to that size.
It will make the Laravel transition easier, as our stack traces are only going to get deeper.
I've also dropped text fixtures in favour of Spatie's PHPUnit snapshot package. I wrote a simple driver for it that replaces the timestamp and file fields in the snapshots with a fixed values.
The snapshot package requires PHP 8.1, but that's fine. We can tag a new major version, and configure our codebase to use the old BasicJsonFormatter to get the same effect in the meantime until we upgrade
https://github.com/fusionspim/fusions/issues/14982
This PR defaults the log handler to use
JsonFormatter
(formerlyBasicJsonFormatter
), and drops ourSmartJsonFormatter
class entirely.Doing this drastically simplifies this package:
I've also dropped text fixtures in favour of Spatie's PHPUnit snapshot package. I wrote a simple driver for it that replaces the
timestamp
andfile
fields in the snapshots with a fixed values.The snapshot package requires PHP 8.1, but that's fine. We can tag a new major version, and configure our codebase to use the old
BasicJsonFormatter
to get the same effect in the meantime until we upgrade