Closed apokryfos closed 3 years ago
You can't serialize that value. I believe you would need to make a class with a method that returns that value ... something like:
class Foo
function getLogObject() {
return (new \Illuminate\Log\LogManager(app()))->driver()->getLogger();
}
}
and then pass that in your config as a callable:
'logObject' => [Foo:class, 'getLogObject'],
Closing due to no response. Feel free to re-open or comment if you are still having issues.
I am trying to cache my configuration while also using the default laravel logger in Laravel 8
laravel new estest
logObject
configuration setting to the documented\Log::getMonolog()
but that does not work (I think that's outdated). I have also tried using'logObject' => (new \Illuminate\Log\LogManager(app()))->driver()->getLogger()
. however when runningphp artisan config:cache
I get an errorYour configuration files are not serializable.
I would like to just use the same logger I use normally and also cache my configuration.
Not sure I'm missing something here. Is it meant to be possible to cache the configuration when doing this? Is there an alternative?