Josh Larson
Sending Laravel logs to Railway's logger
Hey pals, trying to sort out how to actually get Laravel to send logs to Railway's console. I'm using the vanilla Nixpacks PHP/Laravel builder: https://github.com/railwayapp/nixpacks/blob/main/src/providers/php/mod.rs
And I've set my logger.php config to use a stdout driver, which is a copy/paste of the stderr driver except with stdout swapped in:
[
'stdout' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stdout',
],
'ignore_exceptions' => false,
],
]
I'm not seeing anything come through - only nginx logs. Any thoughts on how I could route these to the right place? Off-the-cuff thoughts:
- Does php-fpm swallow these logs? Like, do they go into the ether?
- Or is it possible to write to /dev/stdout from multiple processes like I'm trying to do?
☮️ 🙏
10 replies
Can I install `mysql-client` for a Laravel app without using a custom Dockerfile?
Pretty standard Laravel app without a Dockerfile, and I updated the build command to include
php artisan db:migrate --force
. Here's what I see in the build log:
I've also updated my NIXPACKS_PKGS
to include libmysqlclient
🤔
Any thoughts?5 replies