Score:0

Access PHP error log in AWS Elastic Beanstalk

br flag

I'm running a PHP web app on AWS Elastic Beanstalk, and I've been trying to diagnose some seemingly random (rare) issues users have been encountering after upgrading to PHP 8.

On localhost, I'd have error reporting on for diagnostics, but in production that is disabled (for security reasons), but I'd still like to be able have PHP server errors logged and accessible for me to download.

Elastic Beanstalk allows me to download full logs or the last 100 lines. But neither include PHP errors or warnings. I don't really need them pushed to CloudWatch, just need to be able to access them easily from the AWS EB Console. (I only run one EC2 instance for the application, but don't want to SSH or such into the server.)

If I check PHP info, it's set to Log Errors, and gives the log location:

log location

errors on

I can place config files in the .ebextensions folder of the application, but I can't seem to get it to include PHP logs in the last 100 lines or the zipped log file package I can download from the console.

Tim avatar
gp flag
Tim
I'd suggest you use the Cloudwatch Logs agent to push the logs to CW logs.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.