I've deployed a Laravel app to heroku by following the official guide. It says to change APP_LOG=errorlog
, which I've done.
I've also tried two different versions of this, the commented line being the variation.
$this->app->configureMonologUsing(function($monolog){
// $monolog->pushHandler(new \Monolog\Handler\SyslogHandler('papertrail'));
$monolog->pushHandler(new \Monolog\Handler\StreamHandler('php://stderr', \Monolog\Logger::WARNING));
});
If I use Log::error('something') I'm not seeing anything. I'm looking in both papertrail, and the CLI command heroku logs --tail --app {appname}
You must set LOG_CHANNEL=errorlog
as a Heroku environment variable.
This setting is for Laravel 5.6, in older versions it was other. (and that "old" information is found on most internet sites, when searching for the problem)
This information can be found in .env
file, which values must be manually set in Heroku.
Why?
The .env
is not transferred to heroku, because it is listed in .gitignore
.
BTW: I had the same issue today, seems like the setting you tried was valid for an older version of Laravel. I now use 5.6.