After further research, I see this happens in Monolog\Formatter\LineFormatter
. In short, the brackets are a JSON representation of an empty array. Unfortunately, it doesn't appear that Laravel provides an easy way out of this one, so I ended up subclassing Monolog. I posted the details at this SO post. But since that post is not Laravel-specific, I thought I'd share how to use such a custom LineFormatter
in a Laravel context.
In your app/start/global.php
, by default there's a section that defines logging. It looks like this:
Log::useDailyFiles(storage_path().'/logs/log-'.php_sapi_name().'.txt');
Replace it with this:
$handler = new Monolog\Handler\StreamHandler(
storage_path().'/logs/log-'.php_sapi_name().'.txt');
$handler->setFormatter(new My\Fancy\Monolog\LineFormatter());
Log::getMonolog()->pushHandler($handler);
Enjoy!