By ktWhale
I’ve tried various ways of getting “Runtime Logs” to output anything app-related from my PHP project, for example:
error_log("This is a runtime error log message");
fwrite(STDOUT, "This is a runtime log message\n");
But I’m not getting this anywhere in Runtime Logs whenever I invoke my function. I also set up Log Forward with Logtail but nothing appears there.
I’m wondering what I’m doing wrong?
Basically want I want, is to log certain events as my function runs, to help in debugging etc.
Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey!
I’ve just tested this with this simple PHP app here:
I’ve forked that project and added a error_log
line here:
https://github.com/bobbyiliev/sample-php/blob/main/index.php#L16
And the error_log("This is a runtime error log message");
worked for me:
Is your project open-source by any chance? If so can you share a link here so I can take a quick look?
If the project is not open-source, feel free to share more details on your exact setup or framework that you are using.
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.