Errors do not appear on cloudwatch logs #1664
Answered
by
mnapoli
Maxlegend87
asked this question in
Support
-
Description: But when throwing an error, I can't find the error in the cloudwatch logs:
And I couldn't find anything to fix it. How to reproduce: serverless.yml: service: app-tpv
provider:
name: aws
region: eu-west-1
environment:
APP_ENV: 'production'
DB_USER: bref-ssm:/app-tpv/db-user
DB_PASSWORD: bref-ssm:/app-tpv/db-password
runtime: php-82-fpm
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
iam:
role: arn:aws:iam::*******:role/rolLambda
vpc:
securityGroupIds:
- sg-078d40cdc3873b8af
subnetIds:
- subnet-02a3987de4b3d90ac
- subnet-0405f5e6b445a27ac
- subnet-045a89a1ef12a9e32
plugins:
- ./vendor/bref/bref
functions:
lmbAppTpv:
handler: src/index.php
events:
- httpApi: "GET /"
# Exclude files from deployment
package:
patterns:
- "!node_modules/**"
- "!tests/**"
composer.json: {
"require": {
"bref/bref": "^2.1",
"bref/secrets-loader": "^1.1"
}
} src/index.php: <?php
throw new Exception('Division by zero.');
echo "Hello";
?> |
Beta Was this translation helpful? Give feedback.
Answered by
mnapoli
Oct 13, 2023
Replies: 1 comment 1 reply
-
PHP-FPM behaves like on any server: exceptions are not automatically logged. You need to use an error handler (or a framework that automatically has that feature), see here for more info: #1550 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Maxlegend87
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PHP-FPM behaves like on any server: exceptions are not automatically logged.
You need to use an error handler (or a framework that automatically has that feature), see here for more info: #1550 (comment)