NixPacks (Laravel) - Display by default laravel log files
I want to listen to storage/logs and log into the console.
27 Replies
Project ID:
N/A
N/A
I think you're wrong Brody about prestart.
I created a file watcher for laravel log file and console log by default to see if it works.
@aleks - who wrote prestart.mjs, please confirm that on its own, it has nothing to do with file watching
that is JavaScript, besides that, I don't see how any of this relates to prestart.mjs in any way shape or form
may I know why it's not feasible to set laravel to log to stdout / stderr (I've seen it done before) but it is feasible to write something like that?
Prestart does absolutely nothing with file watching, it just writes some config files and fixes permissions
I've been considering writing functionality to have it pull log files into stdout, though
okay so is there some difficulties to having Laravel send logs to stdout / stderr?
I don't know, I've never tried
I can't imagine it being more than a few changes
From what I saw with the code sent here, it's working fine. The image is the code output, which is fired in prestart.
I mean, to hook a function on prestart what is the file watching the logs
No, prestart exits when your app starts.
I might be able to implement something like this, though - what's your idea? Maybe some ESM modules that are loaded asynchronously in, say, a .nixpacks/hooks directory?
Then, why in local development isn't exiting?
I mean, we can't add start hook on
StartPhase
, a ESM module like you said?1. because now the code you wrote doesn't exit
2. because there's a single
&
nothing your doing has anything to do with prestart.mjs the way you think it does, you are simply just running a node script along side the php appHmm, okay.
I understand now.
I don't have experience in Rust, just trying to understand from other languages knowledge the logic and making tests to see what is working and what is not.
What that code does is it runs the prestart script and then (after the script has exited) runs
php-fpm
and nginx
in parallel.& is not a good way to do that, I know that much
What would you suggest?
parallel or multirun
are those npm packages?
Wouldn't running a nodejs alongside php-fpm and nginx cause a memory increase on server?
~40MB, because of the NodeJS runtime
as aleks has stated, prestart.mjs exits
what you're doing doesn't exist, so yes what you're doing will add memory usage to the service
(the logical continuation of that statement was "if they are, then I have moral objections")
they are most certainly not
good, what are they and how are they better than &
oh multirun does look cool
they both can run two (or more) commands in parallel, and they will exit all commands entirely if one command exits thus allowing railway to restart the container, unlike & where it sends the command to the background where it can die and stay dead