Comments (4)
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)
from laravel-bridge.
Hi!
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)
I get what you mean, in our case the main reason for that is reducing costs
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)
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 vendor/bref/bref
and vendor/bref/laravel-bridge
directories shows three places where this happens (one, two, three) but maybe there are more happening in the layers.
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?
from laravel-bridge.
in our case the main reason for that is reducing costs
Got it, thanks!
I guess reusing the logger configured in the laravel app is not an option right?
It isn't indeed because Laravel isn't booted (in all places).
it would be nice to have control on the structure of what is written (json rather than plain strings)
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 🤔)
from laravel-bridge.
it would be nice to have control on the structure of what is written (json rather than plain strings)
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)
Yes, that would solve the problem, on the condition that the json output follows a certain structure
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 🤔)
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
- created a custom monolog processor to add contextual information about the current lambda execution
- created a custom monolog formatter to produce the output json with the right structure
- configured the logger to write on STDERR
from laravel-bridge.
Related Issues (20)
- View not found in Laravel when I cache the views
- Uploaded files are not shown in S3 Bucket
- Error Unzipped size must be smaller than 209927080 bytes. HOT 1
- SES - Request to AWS SES API failed. Reason: The Security Token included in the request is invalid HOT 1
- [v2] Issues with Build Server HOT 1
- storage directory creation causes permission issues with bref/php-82-fpm-dev:2 HOT 6
- Using multiple queues on a single connection: is this possible? HOT 3
- SQS QueueHandler tried to delete message, got error `400 Bad Request` HOT 7
- Queue worker does not respect `maxExceptions` HOT 8
- SQS - get InvalidClientTokenId (client): The security token included in the request is invalid HOT 1
- Compatibility with Octane 2.x HOT 2
- Cannot deploy project anymore HOT 1
- When using Laravel Passport the storage is overridden to /tmp before the keys are loaded HOT 2
- Reading the AWS Request ID HOT 9
- Is there a way to disable the automatic logging added by this package for "Job Processing" and "Job Processed" ? HOT 6
- If the queue is SQS, retries due to job timeouts are different from retries due to errors.
- App::runningInConsole() returning true on web function when octane is turned on HOT 1
- Invalid configuration value provided for "token". Expected Aws\Token\TokenInterface|Aws\CacheInterface|array|bool|callable, but got string HOT 2
- SQS Session token is stored only in default connection HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-bridge.