php-http / logger-plugin

PSR-3 Logger plugin for HTTPlug
http://docs.php-http.org/en/latest/plugins/logger.html
MIT License
282 stars 7 forks source link

On-demand opt-out per request #23

Closed ro0NL closed 1 year ago

ro0NL commented 1 year ago

Hi,

We have a certain flow that calls a certain API endpoint with their ID from our DB.

Because of data bookkeeping we may get a 4xx response, because their ID in our DB does not exists anymore.

The 4xx response pollutes our logs every now and then.

We do like to have default HTTP traffic logs.

In this case however, we'd like to opt-out :upside_down_face:

TLDR; what about using a special header for that? Thus X-Httplug-LoggerPlugin-Skip. It would be unset before doing the actual request.

Alternative revise the logger concept as a whole, since currently the extension point is only open to formatting. Not log context, log level, or if it should log the request even (this issue).

ro0NL commented 1 year ago

Lowering the log level on-demand, or by extension point, would also work us.

ro0NL commented 1 year ago

Solved using filters in the log UI.