-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output on STDERR during initialization: is there is a way to not having that? #134
Comments
Hi there! Logging to stderr is the default and recommended way to log on Lambda, that's why it is setup that way. That will send the logs automatically to CloudWatch. Moving away from that would be… risky? (not sure what the best wording is) Bref itself logs a lot of things to stdout/stderr, is that not causing issues for you too? (said another way: I think what would need to be changed would be much bigger than just these two lines, or maybe I'm missing something) |
Hi!
I get what you mean, in our case the main reason for that is reducing costs
Maybe we still have to bump into those, as of now the two lines causing the issue are the one mentioned before. A search on the To reinstate that, writing to STDERR is fine, but it would be nice to have control on the structure of what is written (json rather than plain strings). I guess reusing the logger configured in the laravel app is not an option right? |
Got it, thanks!
It isn't indeed because Laravel isn't booted (in all places).
Right, so if all logs were written as JSON that would solve your problem? (I'm not saying it's what we should do, just trying to understand it all) BTW how are you forwarding logs to ELK? Via a Lambda extension, or a Laravel logger? If via PHP code (Laravel logger) do you notice extra latency? (I'd imagine sending the logs over the network might add some 🤔) |
Yes, that would solve the problem, on the condition that the json output follows a certain structure
We do have a lambda extension, written in rust, that is language agnostic, as long the logs produced adhere to a certain json format. In case of the PHP app mentioned before, we
|
Hey there,
the dev team I'm part of is using Bref to deploy a Laravel application on Lambda, using the Octane Handler, and things are going pretty smoothly, thank you Bref! 🙇
We do have a custom layer to send json structured logs to our own ELK-like service: we noticed that during the initialization phase, a couple of strings are written directly to
STDERR
(one, two). This is not great for our setup as it breaks the way we collect logs (in particular, those lines are detected as errors).Is there a way to avoid that? We tried to override
bref-init.php
but is difficult to achieve. The best idea we could come up with is to use a composer script to do the override, but feels a bit too hacky.The most straightforward way to deal with that would be removing those two lines, would it be something that you may consider?
Regardless of the solution, we are willing to work on that 🤗
The text was updated successfully, but these errors were encountered: