Search code examples
error-handlingzend-framework2error-logginglaminas-api-tools

Does Apiglity provide a buil-in error handling and logging?


I'm working on an API project and have to decide over the error handling and logging strategy/concept. So as first step I want to check, whether Apigility provides its own logging functionality.

If I see it correctly, Apigility only provides a minimal error handling for REST specific errors (Apigility documentation -> Error Reporting). That's it. So, only a limited error handling and no logging. Right? But maybe it's wrong and I have just not found the functionality I need. So, is an error handling mechanism provided? Is a logging mechanism provided in Apigility?


Solution

  • It handles error rendering if you use ApiProblem objects to encapsulate your errors.

    It doesn't handle logging out of the box, you'll have to add your application's logging strategy yourself.