1

All webservers including Apache, Nginx, IIS, etc log each request's http status code. I'm trying to understand how to get the Http status code from instrumentation, not from the logs. Is there a way?

1 Answer 1

0

I don't know if it's what you asking for, the word "instrumentation" is a little ambiguous, but you can simply use this PHP funtion :

echo http_response_code();.

It will return you the current status code as an integer, you can push this value in an array every time a page is load so you have editable logs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.