Problem/Motivation

The module label is jsonapi_request_logger and subscribes to an onKernelRequest event, but the log template includes status_code that won't be available until a response is handled, e.g. via onKernelResponse

Steps to reproduce

Make a JSONAPI request, note that Status is logged as N/A

Proposed resolution

Offer an option to subscribe to and log Response so that HTTP code is available.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jonathan_hunt created an issue. See original summary.

dcimorra’s picture

Assigned: Unassigned » dcimorra
lapaty’s picture

Assigned: dcimorra » lapaty

lapaty’s picture

Status: Active » Needs review

  • fc252185 committed on 1.x
    Issue #3485175 by lapaty: Request subscriber can't populate Response...
dcimorra’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for your contribution.

The proposed solution is adapted to what was requested in the incident, providing new functionalities such as the log output format.

From now on, the EventSubscriber attends OnKernelRequest and OnKernelResponse events, to provide as much data as possible in the logs.

Once again, thank you very much.

dcimorra’s picture

Status: Reviewed & tested by the community » Fixed
dcimorra’s picture

Status: Fixed » Closed (fixed)