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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey!
I’ve just tested this with this simple PHP app here:
I’ve forked that project and added a
error_log
line here: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